home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / terms / kermit / b / ikxutl.asm < prev    next >
Encoding:
Assembly Source File  |  1992-09-29  |  218.4 KB  |  2,762 lines

  1. *COPY                                                 IKXUTL            05000000
  2.          CHECKVER IKXUTL,4.2                                   @SC90072 05000500
  3. &STORDS  DSECT                                                 @SC90264 05001000
  4.          DS    (STKDWDS)D    Allow room for stack              @SC90264 05001500
  5.          DFHEIEND ,                                            @SC90264 05002000
  6.          TITLE 'CWDSET/DSPACE Routines - set/show working directory'    05002500
  7. * Set new 'working directory'                                           05003000
  8. * Entry: SCANPTR string has option                                      05003500
  9. * Exit: R15=0 if ok, R15=1 if error or help needed. ERRNUM unchanged.   05004000
  10. CWDSET   ENTER                                                 @SC86164 05004500
  11.          NTOKN N=CWDRSET,H=CWDERR                              @SC86299 05005000
  12.          CLI   0(6),C'*'                                       @SC90264 05005500
  13.          BE    CWDRSET       Any string beginning "*" is dflt  @SC90264 05006000
  14.          LA    1,0(7,6)      Point to last character           @SC90264 05006500
  15.          CLI   0(1),C''''    Is it a quote?                    @SC90264 05007000
  16.          BE    *+8           Yes, chop it off                  @SC90264 05007500
  17.           LA   7,1(,7)       No, get true token length         @SC90264 05008000
  18.          LR    5,7                                             @SC86299 05008500
  19.          ICM   7,8,BLANK                                       @SC86299 05009000
  20.          LA    0,DEST                                          @SC90264 05009500
  21.          LA    1,L'DEST      Length of field                   @SC86299 05010000
  22.          CR    5,1                                             @SC90264 05010500
  23.          BNH   *+6                                             @SC90264 05011000
  24.           LR   5,1           Claim no more than available      @SC90264 05011500
  25.          STH   5,DESTL       Set string length                 @SC90264 05012000
  26.          MVCL  0,6           Copy to filename buffer           @SC86299 05012500
  27.          TR    DEST,UPCASE   And upcase it                     @SC87034 05013000
  28.        NXTFSET DESTL,CWD,E=CWDERR                              @SC90264 05013500
  29.          KCALL KFLCWD,DESTL                                    @SC90264 05014000
  30.          B     RTRN0                                           @SC86295 05014500
  31. CWDRSET  MVI   DESTL+1,1     Set to default                    @SC90264 05015000
  32.          MVI   DEST,C'*'                                       @SC90264 05015500
  33.          KCALL KFLCWD,DESTL                                    @SC90264 05016000
  34.          B     RTRN0                                           @SC86295 05016500
  35. CWDERR   PTEXT 'Must be valid file prefix'                     @SC86299 05017000
  36.          MVI   DESTL+1,1     Set to default                    @SC90264 05017500
  37.          MVI   DEST,C'*'                                       @SC90264 05018000
  38.          KCALL KFLCWD,DESTL                                    @SC90264 05018500
  39.          B     SUBERR                                          @SC86295 05019000
  40. *                                                                       05019500
  41. *        DSPACE Routine - display available disk space         @SC86164 05020000
  42. *                                                                       05020500
  43. * Show space available in 'working directory' or other area             05021000
  44. * Entry: SCANPTR string has option (none => working directory)          05021500
  45. * Exit: R15=0 if ok, R15=1 if error or help needed. ERRNUM unchanged    05022000
  46. DSPACE   ENTER ALT                                             @SC86164 05022500
  47.          CLI   CURFUID,0                                       @SC90264 05023000
  48.          BNE   DSP2                                            @SC90264 05023500
  49.          PTEXT 'No directory defined'                          @SC90264 05024000
  50.          B     SUBERR                                          @SC86299 05024500
  51. DSP2     L     4,LIMKFS      Quota                             @SC90264 05025000
  52.          LA    15,CMD                                          @SC90264 05025500
  53.          BAL   2,EDDEC       Format number                     @SC90264 05026000
  54.          MVC   0(16,15),=C' bytes allowed, '                   @SC90264 05026500
  55.          LA    15,16(,15)                                      @SC90264 05027000
  56.          L     4,USRTOTL     Amount used                       @SC90264 05027500
  57.          BAL   2,EDDEC       Format number                     @SC90264 05028000
  58.          MVC   0(15,15),=C' bytes used in '                    @SC90264 05028500
  59.          MVC   15(LFUID,15),CURFUID                            @SC90264 05029000
  60.          LA    0,15+LFUID(,15) End of message                  @SC90264 05029500
  61.          BAL   2,STAPMSG                                       @SC90264 05030000
  62.          B     RTRN0                                           @SC86295 05030500
  63.          LOCALS ,                                              @SC86295 05031000
  64.          EXIT  ,                                               @SC86295 05031500
  65.          TITLE 'FSPEC Routine - extract filespec from scan string'      05032000
  66. *                                                                       05032500
  67. * Entry: R1->name field, R0=flags selecting operation (see below)       05033000
  68. *        For parse operations, SCANPTR defines the input string.        05033500
  69. *        For getting foreign or display filespec, R7->output buffer     05034000
  70. * Exit: if not FFNEW, then R15=0 if ok, 1 if ?, 2 if bad.               05034500
  71. *        For R15=1 or 2 R3,R4 give message.  ERRNUM may be leftover.    05035000
  72. *                                                                       05035500
  73. *                                 Flags:                  Notes:        05036000
  74. *   Tasks:               FFRCF FFSND FFGET FFNEW                        05036500
  75. * Parse RECV               X                     set ROVR properly      05037000
  76. * Parse SEND 1st                 X                                      05037500
  77. * Parse SEND 2nd           X     X                                      05038000
  78. * Parse GET 1st                        X                                05038500
  79. * Parse GET 2nd            X           X         set ROVR properly      05039000
  80. * Parse F-packet   (FFHDR) X     X     X                                05039500
  81. * Parse for Generic(FFUTL)       X     X         FFWLD: allow partial   05040000
  82. * Parse TAKE                                                            05040500
  83. *                                                                       05041000
  84. * Get unique name                            X     R15: 0=>ok, 1=>bad   05041500
  85. * Interactive name check               X     X     R15: 0=>ok, 1=>bad   05042000
  86. * Get foreign name (FFENC) X                 X     R15->end of string   05042500
  87. * Get display form (FFDSP)       X           X     R15->end of string   05043000
  88. *                                                                       05043500
  89. FSPEC    ENTER                                                 @SC86295 05044000
  90.          STC   0,FSPFLG                                        @SC86295 05044500
  91.          LR    5,0                                             @SC88049 05045000
  92.          SRL   5,4           Convert flags to index            @SC88049 05045500
  93.          LR    0,1           Copy ptr to filespec              @SC86295 05046000
  94.          TM    FSPFLG,FFNEW                                    @SC86295 05046500
  95.          BO    FSPWRN                                          @SC86295 05047000
  96.          L     2,ADR         Ptr to text string for analysis   @SC90264 05047500
  97.          C     2,=A(KERMIT)  Is it within Kermit?              @SC90264 05048000
  98.          BL    SCANFXZ       No, we're safe                    @SC90264 05048500
  99.          C     2,=A(FOPSTR)  (last CSECT in Kermit)            @SC90264 05049000
  100.          BH    SCANFXZ                                         @SC90264 05049500
  101.          ICM   3,15,LEN      Yes, but is it non-empty?         @SC90264 05050000
  102.          BNP   SCANFXZ       No, don't need to copy            @SC90264 05050500
  103.          BCTR  3,0           Yes, set up for MVC               @SC90264 05051000
  104.          L     4,STRBUF      Ptr to temporary area             @SC90264 05051500
  105.          MVC   0(,4),0(2)                                      @SC90264 05052000
  106.          EX    3,*-6         Move proper chunk                 @SC90264 05052500
  107.          ST    4,ADR         Replace ptr to string             @SC90264 05053000
  108. SCANFXZ  DS    0H                                              @SC90264 05053500
  109.          LR    8,1           Save ptr to filespec              @SC86299 05054000
  110.          USING FABFID,8      Map filespec                      @SC90264 05054500
  111.          XC    FABFID,FABFID Clear filespec                    @SC90264 05055000
  112.          MVC   FABFUID,DEST  Init user id                      @SC90264 05055500
  113.          PTEXT 'Invalid filespec'                              @SC90264 05056000
  114.          MVI   ERRNUM,ERRFNE Assume bad file name              @SC86158 05056500
  115.          IC    5,FSP0(5)     Get dispatch adr                  @SC88049 05057000
  116.          B     FSP0(5)       Go to proper handler              @SC88049 05057500
  117. *               TAKE        GET 1st    SEND 1st    Generic     @SC88049 05058000
  118. FSP0    DC AL1(FSPCPY-FSP0,FSPSN2-FSP0,FSPASC-FSP0,FSPUTL-FSP0) SC88049 05058500
  119. *               RECEIVE     GET 2nd    SEND 2nd    F-packet    @SC88049 05059000
  120.         DC AL1(FSPRC-FSP0,FSPRC-FSP0,FSPSN2-FSP0,FSPHD-FSP0)   @SC88049 05059500
  121. FSPUTL   TM    FSPFLG,FFWLD  Utility: default to all files?    @SC88049 05060000
  122.          BZ    FSPASC        No                                @SC86295 05060500
  123.          LA    1,LFID                                          @SC88043 05061000
  124.          LA    14,DEST       Default to prefix                 @SC88043 05061500
  125. *                            Convert to default filespec       @SC90264 05062000
  126. FSPASC   TM    FL2,SRV       Server mode?                      @SC86295 05062500
  127.          BZ    FSPCPY        No, don't need to convert         @SC86295 05063000
  128.          ICM   15,15,LEN     Get length                        @SC86295 05063500
  129.          BZ    FSPCPY                                          @SC86295 05064000
  130.          BCTR  15,0          Correct for EX                    @SC86158 05064500
  131.          L     5,ADR         Get string ptr                    @SC89215 05065000
  132.          EX    15,FSPTRAE    Change to EBCDIC                  @SC89215 05065500
  133.          EX    15,FSPTRUP    Upcase                            @SC89215 05066000
  134.          B     FSPCPY                                          @SC86295 05066500
  135. FSPTRAE  TR    0(,5),ATOED                                     @SC89301 05067000
  136. FSPTRUP  TR    0(,5),UPCASE                                    @SC89215 05067500
  137. FSPRC    NI    FL1,255-ROVR  Setup for RECEIVE                 @SC86295 05068000
  138.          NI    FL4,255-NMOK-NMCHNG  Collision not checked yet  @SC90033 05068500
  139.          MVI   FABFNAM,C'$'  Allow missing filespec            @SC90264 05069000
  140.          B     FSPCPY                                          @SC86295 05069500
  141. FSPHD    MVI   FABFNAM,1     Use default if missing filespec   @SC90264 05070000
  142.          B     FSPCPY                                          @SC86299 05070500
  143. FSPSN2   CLI   BRK,C','                                        @SC88306 05071000
  144.          BE    RTRN0         No foreign name: multiple format  @SC88306 05071500
  145.          NTOKN H=FSP2H,N=RTRN0                                 @SC88306 05072000
  146.          LA    7,1(,7)       Get token length                  @SC89179 05072500
  147.          LA    1,L'JFNAM                                       @SC86295 05073000
  148.          CR    7,1           Does it fit?                      @SC89179 05073500
  149.          BNH   *+6           Yes                               @SC86224 05074000
  150.           LR   7,1           Use what we can                   @SC86224 05074500
  151.          LR    3,0                                             @SC86295 05075000
  152.          STC   7,0(3)        Save length                       @SC86224 05075500
  153.          LA    0,1(3)                                          @SC86295 05076000
  154.          MVCL  0,6           Get fn, at least                  @SC86224 05076500
  155.          B     RTRN0                                           @SC86295 05077000
  156. *                                                                       05077500
  157. FSPCPY   NTOKN H=FSPH,N=FSPZ                                   @SC86299 05078000
  158. FSPCP2   KCALL FOPSTR,LFID(,8),E=FSPINV                        @SC89218 05078500
  159. *  id.TD    -> FABFTD, 4-byte ---, 4-byte destid, 4 blanks     @SC90264 05079000
  160. *  id.TS    -> FABFTS, 4-byte ---, 8-byte id                   @SC90264 05079500
  161. *  id.TSAUX -> FABFTS, 4-byte ---, 8-byte id                   @SC90264 05080000
  162. *  id.TSMAIN-> FABFTS+FABFMAIN, 4-byte ---, 8-byte id          @SC90264 05080500
  163. *  id       -> FABFTS, 4-byte ---, 8-byte id (but see below)   @SC90264 05081000
  164. *  id.PGM   -> FABFPGM, 4-byte parm, 8-byte pgm id             @SC90264 05081500
  165. *  id.SPOOL -> FABFSPL, 4-byte class, 8-byte spool name        @SC90264 05082000
  166. *  id.TAKE  -> FABFTAK, 4-byte uid, 8-byte file id             @SC90264 05082500
  167. *  id       -> (same, if TAKE or GIVE command)                 @SC90264 05083000
  168. *  'name.etc-> FABFSPL, 4-byte ', name ptr, 2-byte offset, len @SC90264 05083500
  169.          L     2,QFNPTR      Last-used buffer                  @SC90264 05084000
  170.          MVC   QFNPTR,QFNSIZ(2)   Set up for next              @SC90264 05084500
  171.          L     2,QFNPTR      Get ptr                           @SC90264 05085000
  172.          MVC   0(QFNSIZ,2),DEST+1 Copy prefix to buffer, less '@SC90264 05085500
  173.          LH    14,DESTL      Get length so far                 @SC90264 05086000
  174.          BCTR  14,0                                            @SC90264 05086500
  175.          CLI   0(6),C''''    Is name actually spelled out?     @SC90264 05087000
  176.          BNE   FSPQF1        No, keep prefix                   @SC90264 05087500
  177.          SR    14,14         Yes, start over                   @SC90264 05088000
  178.          LA    6,1(,6)        and skip '                       @SC90264 05088500
  179.          BCTR  7,0                                             @SC90264 05089000
  180.          MVI   FABFUID,C'''' Qualified name                    @SC90264 05089500
  181. FSPQF1   LA    1,0(7,6)      Point to last character           @SC90264 05090000
  182.          CLI   0(1),C''''    Does it end with a quote?         @SC90264 05090500
  183.          BE    *+8           Yes, chop it off                  @SC90264 05091000
  184.           LA   1,1(,1)       No, keep last char                @SC90264 05091500
  185.          LR    0,6                                             @SC90264 05092000
  186.          SR    1,0           Set up for MVCL                   @SC90264 05092500
  187.          ICM   1,8,BLANK                                       @SC90264 05093000
  188.          STH   14,QFNSHB     Save offset to start of short name@SC90264 05093500
  189.          AR    14,2          Ptr within buffer                 @SC90264 05094000
  190.          LA    15,QFNSIZ(,2) End of buffer                     @SC90264 05094500
  191.          SR    15,14                                           @SC90264 05095000
  192.          MVCL  14,0          Now, QFN is set, just in case     @SC90264 05095500
  193.          EX    7,FSPTRUPD    Convert to upper case             @SC90264 05096000
  194.          CLI   0(6),C' '     Hope it didn't start with dot     @SC90264 05096500
  195.          BE    FSPINV        Oops                              @SC90264 05097000
  196.          TM    FSPFLG,FFRCF                                    @SC86295 05097500
  197.          BZ    *+8                                             @SC86295 05098000
  198.           OI   FL1,ROVR      Overwrite received fname          @SC86295 05098500
  199.          MVI   FABFLGS,FABFTS Default is tmp.stor.             @SC90264 05099000
  200.          TM    FSPFLG,X'70'  TAKE file?                        @SC91150 05099500
  201.          BNZ   *+8           No                                @SC91150 05100000
  202.           MVI  FABFLGS,FABFTAK Yes, default is TAKE            @SC90264 05100500
  203.          MVI   TRTBL+C'/',1  Also look for slash               @SC90264 05101000
  204. FSPCPUID LA    1,1(7,6)      Past end                          @SC90264 05101500
  205.          EX    7,FSPTRTB     Find what was dot, if any         @SC90264 05102000
  206.          MVI   TRTBL+C'/',0                                    @SC90264 05102500
  207.          LR    5,1           Save ptr to first dot             @SC90264 05103000
  208.          BZ    FSPCP3        No dot, assume TS                 @SC90264 05103500
  209.          CLI   0(1),C'/'                                       @SC90264 05104000
  210.          BNE   FSPCPUIZ      No slash either, go on            @SC90264 05104500
  211.          SR    1,6           Get length of uid                 @SC90264 05105000
  212.          BNP   FSPINV        Empty uid, no good                @SC90264 05105500
  213.          LR    0,6           Start of uid                      @SC90264 05106000
  214.          LA    1,1(,1)       Length of uid plus '/'            @SC90264 05106500
  215.          AR    6,1           Adjust ptrs to text               @SC90264 05107000
  216.          SR    7,1                                             @SC90264 05107500
  217.          BNP   FSPINV        Nothing left, error               @SC90264 05108000
  218.          BCTR  1,0           Get length of uid again           @SC90264 05108500
  219.          LA    14,FABFUID                                      @SC90264 05109000
  220.          LA    15,LFUID                                        @SC90264 05109500
  221.          ICM   1,8,BLANK     Set to blank-fill                 @SC90264 05110000
  222.          MVCL  14,0          Copy to FID                       @SC90264 05110500
  223.          CLM   1,7,F0        Uid all used up?                  @SC90264 05111000
  224.          BNE   FSPINV        No, was too long                  @SC90264 05111500
  225.          B     FSPCPUID      Now look for file name            @SC90264 05112000
  226. FSPCPUIZ LA    1,1(7,6)      Past end                          @SC90264 05112500
  227.          AR    7,6           Ptr to last char                  @SC90264 05113000
  228.          SR    7,5           Anything after 1st dot?           @SC90264 05113500
  229.          BNP   FSPINV        No, error                         @SC90264 05114000
  230.          BCTR  7,0                                             @SC90264 05114500
  231.          CLI   FABFUID,C'''' Qualified name?                   @SC90264 05115000
  232.          BE    FSPQFN        Yes                               @SC90264 05115500
  233. *        EX    7,FSPTRTB5    Look for another dot              @SC90264 05116000
  234.          SR    1,5           Get length of type + 1            @SC90264 05116500
  235.          S     1,F2          Length - 1                        @SC90264 05117000
  236.          BM    FSPINV        Null, must have been ..           @SC90264 05117500
  237.          LA    14,FSPTYPS    Start of table                    @SC90264 05118000
  238.          SR    15,15                                           @SC90264 05118500
  239. FSPCPTLP CLI   0(14),255                                       @SC90264 05119000
  240.          MVI   FABFLGS,0     Just in case not found            @SC90264 05119500
  241.          BE    FSPINV        Not found                         @SC90264 05120000
  242.          MVC   FABFLGS,1(14) Copy flags                        @SC90264 05120500
  243.          IC    15,0(,14)     Get length of possible type       @SC90264 05121000
  244.          EX    1,FSPCPCLC    See if a match                    @SC90264 05121500
  245.          LA    14,3(15,14)   Space over this one, in case      @SC90264 05122000
  246.          BNE   FSPCPTLP      No match, keep looking            @SC90264 05122500
  247.          CR    1,15          Seems to match.  Same length?     @SC90264 05123000
  248.          BNE   FSPCPTLP      No match, keep looking            @SC90264 05123500
  249. FSPCP3   LA    15,1(7,6)     Past end once more                @SC90264 05124000
  250.          SR    5,6           Get length of token               @SC90264 05124500
  251.          LR    7,5                                             @SC90264 05125000
  252.          ICM   7,8,BLANK                                       @SC90264 05125500
  253.          LA    1,LFFNM                                         @SC90264 05126000
  254.          LA    0,FABFNAM     Start of name per se              @SC90264 05126500
  255.          MVCL  0,6           Copy to destination name          @SC90264 05127000
  256.          TM    FABFLGS,FABFTAK                                 @SC91150 05127500
  257.          BZ    FSPCP4        Leave fileclass alone if not TAKE @SC91150 05128000
  258.          CLI   FABFUID,C'*'  Self?                             @SC91150 05128500
  259.          BNE   FSPCP4                                          @SC91150 05129000
  260.          MVC   FABFUID,KUSERID Yes, set to userid              @SC91150 05129500
  261. FSPCP4   DS    0H                                              @SC91150 05130000
  262.          TM    FABFLGS,FABFTD                                  @SC90264 05130500
  263.          BZ    RTRN0                                           @SC90264 05131000
  264.          CLI   FABFNAM+4,C' ' TD id must be only 4 bytes       @SC90264 05131500
  265.          BNE   FSPINV                                          @SC90264 05132000
  266.          B     RTRN0                                           @SC87034 05132500
  267. *                                                                       05133000
  268. FSPQFN   MVI   TRTBL+C'(',1                                    @SC90264 05133500
  269.          EX    7,FSPTRTB5    Find next dot or (, if any        @SC90264 05134000
  270.          MVI   TRTBL+C'(',0                                    @SC90264 05134500
  271.          SR    1,6                                             @SC90264 05135000
  272.          STH   1,QFNSHL                                        @SC90264 05135500
  273.          MVC   FABFNAM(8),QFNPTR Save ptrs to QFN in FAB       @SC90264 05136000
  274.          MVI   FABFLGS,FABFSPL Treat like a spool file, CL='   @SC90264 05136500
  275.          B     RTRN0                                           @SC90264 05137000
  276. *                                                                       05137500
  277. FSPTRUPD TR    0(,6),FSPUPDOT Upcase and dot to blank          @SC90264 05138000
  278. FSPDSPMV MVC   1(,1),2(14)   Copy type from table              @SC90264 05138500
  279. FSPCPCLC CLC   2(,14),1(5)   Compare to type table             @SC90264 05139000
  280. FSPTRTB5 TRT   1(,5),TRTBL   Look for 2nd blank                @SC90264 05139500
  281. FSPTRTB  TRT   0(,6),TRTBL   Look for blank                    @SC90264 05140000
  282. *                                                                       05140500
  283. * Table of file types: AL1(len-1,flags),C'type'                @SC90264 05141000
  284. FSPTYPS  DC    AL1(2-1,FABFTS),C'TS'                           @SC90264 05141500
  285.          DC    AL1(5-1,FABFTS),C'TSAUX'                        @SC90264 05142000
  286.          DC    AL1(6-1,FABFTS+FABFMAIN),C'TSMAIN'              @SC90264 05142500
  287.          DC    AL1(2-1,FABFTD),C'TD'                           @SC90264 05143000
  288.          DC    AL1(3-1,FABFPGM),C'PGM'                         @SC90264 05143500
  289.          DC    AL1(5-1,FABFSPL),C'SPOOL'                       @SC90264 05144000
  290.          DC    AL1(4-1,FABFTAK),C'TAKE'                        @SC90264 05144500
  291.          DC    AL1(255)                                        @SC90264 05145000
  292. *                                                                       05145500
  293. FSPZ     LA    6,1           Update counter                    @SC86299 05146000
  294.          A     6,EVCTR                                         @SC86299 05146500
  295.          ST    6,EVCTR                                         @SC86299 05147000
  296.          UNPK  FSPFNAM(5),EVCTR(5)                             @SC90264 05147500
  297.          TR    FSPFNAM(6),TRHEX Get unique DDNAME              @SC90264 05148000
  298.          MVI   FSPFNAM,C'K'                                    @SC90264 05148500
  299.          L     15,DFHEIBP                                      @SC90264 05149000
  300.          MVC   FSPFNAM+4(4),EIBTRMID-DFHEIBLK(15) Make unique  @SC90264 05149500
  301.          MVC   FSPFNAM+8(3),=C'.TS'                            @SC90264 05150000
  302.          LA    6,FSPFNAM     Default name                      @SC90264 05150500
  303.          LA    7,11-1                                          @SC90264 05151000
  304.          CLI   FABFNAM,1                                       @SC90264 05151500
  305.          BE    FSPCP2        Get default DEST                  @SC90264 05152000
  306.          BH    RTRN0         Don't insist                      @SC86299 05152500
  307.          PTEXT 'Missing filespec'                              @SC90264 05153000
  308. FSPINV   LA    15,2                                            @SC86295 05153500
  309.          B     FSPPTRS                                         @SC86295 05154000
  310. *                                                                       05154500
  311. FSPH     PTEXT 'Enter filespec[<first-last[_CC]>]'             @SC91224 05155000
  312.          CLI   FSPFLG,FFSND  SEND 1st?                         @SC89261 05155500
  313.          BE    *+8           Yes, use whole message            @SC89261 05156000
  314.           SH   4,=H'19'      Chop off option part              @SC91224 05156500
  315.          B     FSP0H                                           @SC86295 05157000
  316. FSP2H    PTEXT 'Enter foreign filespec'                        @SC86295 05157500
  317. FSP0H    LA    15,1                                            @SC86295 05158000
  318. FSPPTRS  RETREG 3,4                                            @SC86295 05158500
  319. FSPRET   RET   ,                                               @SC86295 05159000
  320. *                                                                       05159500
  321. * Non-parsing functions . . .                                           05160000
  322. *                                                                       05160500
  323. * Get unique filespec                                                   05161000
  324. FSPWRN   LR    8,1           Save name ptr                     @SC90264 05161500
  325.          TM    FSPFLG,FFENC                                    @SC86295 05162000
  326.          BO    FSPENC        Encode name into buffer           @SC86295 05162500
  327.          TM    FSPFLG,FFDSP                                    @SC86295 05163000
  328.          BO    FSPDSP        Copy name into buffer for display @SC86295 05163500
  329.          TM    FL4,NMOK      Already checked?                  @SC87012 05164000
  330.          BO    RTRN0         Yes, ok                           @SC87012 05164500
  331.          MVC   XFILE,FABFID  Save original name                @SC90033 05165000
  332.          MVC   FSPFID,FABFID Save original name                @SC87015 05165500
  333.          TM    FABFLGS,FABFPGM Pipe?                           @SC90264 05166000
  334.          BO    FSPNOKD       Yes, name is already unique       @SC90264 05166500
  335.          LA    6,FSPFNAM+6   End of id                         @SC90264 05167000
  336.          BCTR  6,0                                             @BS86001 05167500
  337.          CLI   0(6),C' '     Find end of token                 @BS86001 05168000
  338.          BE    *-6                                             @BS86001 05168500
  339.          LA    5,10+1        Allowed retries                   @BS86001 05169000
  340.          LA    7,C'0'        Extra character                   @BS86001 05169500
  341. FSPTOPN  OPENF T,FSPFID,E=FSPNOKA No collision                 @SC91150 05170000
  342.          CLI   FSPFID+1,C'''' Quoted file name?                @SC90264 05170500
  343.          BE    FSPCOLL       Yes, give up                      @SC90264 05171000
  344.          OI    FL4,NMCHNG    Remember collision occurred       @SC90033 05171500
  345.          MVI   1(6),C'$'     Yes, modify id                    @BS86001 05172000
  346.          TM    FSPFID,FABFTAK TAKE file?                       @SC90264 05172500
  347.          BO    *+8           Yes, keep it so                   @SC90264 05173000
  348.           MVI  FSPFID,FABFTS No, alternate would always be TS  @SC90264 05173500
  349.          STC   7,2(,6)       Serialize                         @BS86001 05174000
  350.          LA    7,1(7)        Bump counter                      @BS86001 05174500
  351.          BCT   5,FSPTOPN                                       @SC87015 05175000
  352. FSPCOLL  PTEXT 'File name collision'                           @SC90264 05175500
  353.          B     FSP0H         Return ptrs and rc=1              @SC88049 05176000
  354. FSPNOKA  TM    FSPFID,FABFTD TD?                               @SC91150 05176500
  355.          BZ    FSPNOKD       No, it's really ok                @SC91150 05177000
  356.          CLI   DSKSTT+FDBFL2-FABD,0  Did we find anything?     @SC91150 05177500
  357.          BE    FSPCOLL       Nothing, can't write there        @SC91150 05178000
  358. FSPNOKD  MVC   FABFID,FSPFID Copy name back                    @SC87015 05178500
  359.          OI    FL4,NMOK                                        @SC87015 05179000
  360.          B     RTRN0                                           @SC87015 05179500
  361. *                                                                       05180000
  362. * Encode name at (R8) into (R7) buffer (in ASCII), possibly with        05180500
  363. *  substitution from JFSPEC, but disable subsequent subst.              05181000
  364. *  Return updated ptr in R15                                            05181500
  365. FSPENC   CLI   FABFLGS,0     Valid filespec?                   @SC90264 05182000
  366.          BNE   FSPENC1       Yes, do it                        @SC90264 05182500
  367.          MVC   0(16,7),=C'Invalid filespec'                    @SC90264 05183000
  368.          LA    1,16(,7)      Mark end of message               @SC90264 05183500
  369.          B     FSPENTR       And use it                        @SC90264 05184000
  370. FSPENC1  LA    1,JFSPEC      Complex string?                   @SC90264 05184500
  371.          BAL   14,PAKFOR                                       @SC86224 05185000
  372.          BNZ   FSPECPZ       Yes, name overridden              @SC86299 05185500
  373.          LR    1,7           Set ptr                           @SC90264 05186000
  374.          BAL   9,FSPDSPL     Get id                            @SC90264 05186500
  375. FSPENTR  DS    0H            Translate and adjust ptr          @SC88070 05187000
  376.          TR    0(LFID+8,7),ETOAD                               @SC89301 05187500
  377.          LR    7,1           Advance ptr                       @SC86299 05188000
  378. FSPECPZ  MVI   JFSPEC,0      Turn off string                   @SC86299 05188500
  379. FSPENR   LR    15,7          Save ptr                          @SC86295 05189000
  380.          B     FSPRET                                          @SC86295 05189500
  381. *                                                                       05190000
  382. * Copy name at (R8) into (R7) buffer in display form           @SC90264 05190500
  383. *  Return updated ptr in R15                                            05191000
  384. FSPDSP   LR    1,7           Output ptr                        @SC90264 05191500
  385.          TM    FABFLGS,FABFTAK TAKE file?                      @SC90264 05192000
  386.          BZ    FSPDSP2       No, uid is ignored                @SC90264 05192500
  387.          CLC   FABFUID,CURFUID Yes.  Is uid the usual?         @SC91150 05193000
  388.          BE    FSPDSP2       Yes, suppress it                  @SC90264 05193500
  389.          MVC   0(LFUID,1),FABFUID                              @SC90264 05194000
  390.          TRT   0(LFUID,1),TRTBL  Check for trailing blanks     @SC90264 05194500
  391.          BNZ   *+8                                             @SC90264 05195000
  392.           LA   1,LFUID(,1)   None, set ptr to max              @SC90264 05195500
  393.          MVI   0(1),C'/'                                       @SC90264 05196000
  394.          LA    1,1(,1)       Skip over '/'                     @SC90264 05196500
  395. FSPDSP2  BAL   9,FSPDSPL     Encode id                         @SC90264 05197000
  396.          LR    15,1          End of string                     @SC90264 05197500
  397.          B     FSPRET                                          @SC86299 05198000
  398. *  Encode id from R8 into buffer at R1, return new ptr in R1   @SC90264 05198500
  399. *  Uses R2,R14,R15.  Return via R9                             @SC90264 05199000
  400. FSPDSPL  CLI   FABFUID,C'''' Quoted file name?                 @SC90264 05199500
  401.          BNE   FSPDSPL1      No, do normal decoding            @SC90264 05200000
  402.          ICM   14,15,FABFNAM Yes, get ptr to buffer            @SC90264 05200500
  403.          AH    14,FABFNAM+4  Get offset for display form       @SC90264 05201000
  404.          S     14,F2         Back up to set up MVC             @SC90264 05201500
  405.          MVI   0(1),C''''    Insert quote to flag it           @SC90264 05202000
  406.          LH    15,FABFNAM+6  Get length of name                @SC90264 05202500
  407.          BCTR  15,0          Correct for MVC                   @SC90264 05203000
  408.          EX    15,FSPDSPMV   Move to the output                @SC90264 05203500
  409.          LA    1,2(15,1)     Point past the end                @SC90264 05204000
  410.          BR    9             All done                          @SC90264 05204500
  411. FSPDSPL1 MVC   0(LFFNM,1),FABFNAM Grab id                      @SC90264 05205000
  412.          TRT   0(LFFNM,1),TRTBL  Check for trailing blanks     @SC90264 05205500
  413.          BNZ   *+8                                             @SC90264 05206000
  414.           LA   1,LFFNM(,1)                                     @SC90264 05206500
  415.          MVI   0(1),C'.'     Insert dot                        @SC90264 05207000
  416.          LA    14,FSPTYPS    Start of table                    @SC90264 05207500
  417.          SR    15,15                                           @SC90264 05208000
  418. FSPDSPLP CLI   0(14),255                                       @SC90264 05208500
  419.          BER   9             Not found, omit type (???)        @SC90264 05209000
  420.          MVC   FSPFID(1),1(14)  Copy flags                     @SC90264 05209500
  421.          IC    15,0(,14)     Get length of possible type       @SC90264 05210000
  422.          EX    15,FSPDSPMV   Copy type to string               @SC90264 05210500
  423.          LA    14,3(15,14)   Space over this one, in case      @SC90264 05211000
  424.          NC    FSPFID(1),FABFLGS See if same type              @SC90264 05211500
  425.          BZ    FSPDSPLP      No match, keep looking            @SC90264 05212000
  426.          LA    1,2(15,1)     Point past the end                @SC90264 05212500
  427.          BR    9                                               @SC90264 05213000
  428.          DROP  8                                               @SC90264 05213500
  429. *                                                                       05214000
  430. * Table to convert EBCDIC text to upper case + dot to blank    @SC89215 05214500
  431. FSPUPDOT DC    (C'.')AL1(*-FSPUPDOT)                           @SC89215 05215000
  432.          DC    C' '                                            @SC89215 05215500
  433.          DC    (127-C'.')AL1(*-FSPUPDOT)                       @SC89215 05216000
  434.          HTBL  80,C1,C2,C3,C4,C5,C6,C7,C8,C9,8A,8B,8C,8D,8E,8F @SC89268 05216500
  435.          HTBL  90,D1,D2,D3,D4,D5,D6,D7,D8,D9,9A,9B,9C,9D,9E,9F @SC89268 05217000
  436.          HTBL  A0,A1,E2,E3,E4,E5,E6,E7,E8,E9,AA,AB,AC,AD,AE,AF @SC89268 05217500
  437.          DC    080AL1(*-FSPUPDOT)                              @SC89215 05218000
  438.          LOCALS ,                                              @SC86295 05218500
  439. FSPFID   DS    CL(LFID)                                        @SC88342 05219000
  440. FSPFNAM  EQU   FSPFID+1+LFUID File name per se                 @SC90264 05219500
  441. FSPFLG   DS    X             Filespec flags                    @SC86295 05220000
  442. FSPEC    EXIT                                                  @SC86295 05220500
  443.          TITLE 'KHELP routine - perform HELP command'                   05221000
  444. * Handle HELP command, rest of string given by SCANPTR.                 05221500
  445. * On entry, R6->help command string                                     05222000
  446. KHELP    ENTER ,                                               @SC86355 05222500
  447.          LR    8,6           Save ptr to command               @SC88043 05223000
  448.          SR    5,5           Clear length of extra word        @SC90264 05223500
  449.          NTOKN N=KHLI        See if subcommand given           @SC86355 05224000
  450.          L     1,=A(USNCMD)  Command table                     @SC87117 05224500
  451. KHSCAN   SCAN  (1),KHLF,NODISP                                 @SC86355 05225000
  452.          WTEXT 'Not a valid subcommand'   Not found            @SC86355 05225500
  453.          RET   ,                                               @SC86355 05226000
  454. KHLF     CLM   7,8,F0        Just '?'                          @SC86355 05226500
  455.          BE    RTRN          Yes, done                         @SC86355 05227000
  456.          CLC   =C'SET',KWNAME(1)                               @SC90264 05227500
  457.          BNE   KHNORM        Normal subcommands                @SC90264 05228000
  458.          PTEXT 'SET',AREG=4,LREG=5                             @SC90264 05228500
  459.          NTOKN N=KHSET       Just SET -- no parameter          @SC90264 05229000
  460.          L     1,=A(SETCMDKW)  Keyword table                   @SC90264 05229500
  461.          B     KHSCAN        Go back and check parameter       @SC90264 05230000
  462. KHNORM   DS    0H                                              @SC90264 05230500
  463.          LA    6,KWNAME(,1)  Ptr to name in table              @SC90264 05231000
  464.          SR    7,7                                             @SC90264 05231500
  465.          IC    7,KWMIN(,1)   Length - 1 of abbrev              @SC90264 05232000
  466.          LA    7,1(,7)                                         @SC90264 05232500
  467.          B     KHLJ          Create command string for typing  @SC90264 05233000
  468. KHSET    SR    7,7           Plain SET with no parameter       @SC90264 05233500
  469.          B     KHLJ          Do it                             @SC90264 05234000
  470. KHLI     PTEXT 'KERMITCM',AREG=6,LREG=7                        @SC90264 05234500
  471. KHLJ     PTEXT '&TYPCMD ',AREG=0,LREG=1                        @SC90264 05235000
  472.          LA    14,KHLPBF                                       @SC90264 05235500
  473.          LR    15,1                                            @SC90264 05236000
  474.          MVCL  14,0          Copy 'type' to buffer             @SC90264 05236500
  475.          MVC   0(LFUID+1,14),SYSUID  Set up filespec           @SC90264 05237000
  476.          LA    14,LFUID+1(,14)                                 @SC90264 05237500
  477.          LR    15,5                                            @SC90264 05238000
  478.          LA    5,8           Keep track of available space     @SC90264 05238500
  479.          MVCL  14,4          Copy 'SET' to buffer, if needed   @SC90264 05239000
  480.          LR    15,7                                            @SC90264 05239500
  481.          LR    7,5           Remaining space                   @SC90264 05240000
  482.          MVCL  14,6          Copy 'subcmd' to buffer           @SC90264 05240500
  483.          LA    15,4          Length of suffix desired          @SC90264 05241000
  484.          CR    15,7                                            @SC90264 05241500
  485.          BNH   *+6                                             @SC90264 05242000
  486.           LR   15,7          Can't fit it all                  @SC90264 05242500
  487.          LA    6,=CL4'HELP'  Suffix                            @SC90264 05243000
  488.          MVCL  14,6                                            @SC90264 05243500
  489.          MVC   0(5,14),=C'.TAKE'  Set file type                @SC90264 05244000
  490.          LA    6,5(,14)      End of string                     @SC90264 05244500
  491.          LA    0,KHLPBF      Start of command                  @SC90264 05245000
  492.          SR    6,0           Total length                      @SC88043 05245500
  493.          NI    FL4,255-UCMD                                    @SC88043 05246000
  494.          KCALL SUPFNC,3      Do it                             @SC86355 05246500
  495.          RET   ,                                               @SC86355 05247000
  496.          LOCALS ,                                                       05247500
  497. KHLPBF   DS    CL4,C,CL(LFUID+1),CL8,CL5  Space for command    @SC90264 05248000
  498. KHELP    EXIT  ,                                               @SC87007 05248500
  499.          TITLE 'SUPFNC Routine - various supervisor functions' @SC86158 05249000
  500. SUPFNC   ENTER                                                 @SC86295 05249500
  501. *  On entry, R1 = operation code, R0 = possible ptr            @SC86158 05250000
  502. * Exit: R15 set (0 => ok, <0 => illegal cmd, >0 => depends)             05250500
  503. *       ERRNUM set appropriately (R1=1,3,4) or unchanged (2,5-11)       05251000
  504. * 1 -> Start typeout interception.  N.B.  &MAXLR >> 2048 for this       05251500
  505. * 2 -> Clean up afterwards and stop interception                        05252000
  506. * 3 -> Execute host command with or without interception                05252500
  507. *      If UCMD set, SCANPTR gives text, else R0->text,R6=len            05253000
  508. * 4 -> (not used)                                                       05253500
  509. * 5 -> Stop interception if going                                       05254000
  510. * 6 -> Retrieve original cmd parm string into CBUF (R15=1 if null)      05254500
  511. * 7 -> Test for stacked lines, return number in R15                     05255000
  512. * 8 -> Log off (must return to TMP)                                     05255500
  513. * 9 -> Wait specified time                                              05256000
  514. * 10-> Return clock time in R15 (centisec)                              05256500
  515. * 11-> Setup up new prompt string at (R0)                               05257000
  516.          AR    1,1                                             @SC89268 05257500
  517.          LH    1,SFC0-2(1)   Get dispatch address              @SC89268 05258000
  518.          B     SFC0(1)                                         @SC89268 05258500
  519. SFC0     DC    Y(ICPBEG-SFC0,ICPFIN-SFC0,SFCHST-SFC0)  1-3     @SC89268 05259000
  520.          DC    Y(SFCILL-SFC0,ICPRST-SFC0,SFCLIN-SFC0)  4-6     @SC89268 05259500
  521.          DC    Y(SFCSTK-SFC0,SFCKIL-SFC0,SFCWT-SFC0)   7-9     @SC89268 05260000
  522.          DC    Y(SFCCLK-SFC0,SFCPRP-SFC0)             10-11    @SC89268 05260500
  523. *                                                                       05261000
  524. * Start interception, initialize ptrs                          @SC86158 05261500
  525. ICPBEG   MVI   ERRNUM,ERRNOE OK                                @SC89268 05262000
  526.          L     1,WBUF        Output buffer                     @SC90264 05262500
  527.          LA    0,2048(,1)    Skip over some, to be safe        @SC90264 05263000
  528.          SH    1,=Y(MAXDOF)                                    @SC90264 05263500
  529.          A     1,F64KP       End of buffer                     @SC90264 05264000
  530.          LR    15,0                                            @SC86158 05264500
  531.          STM   15,1,TXTPTR   Save                              @SC86158 05265000
  532.          SR    1,0           Get length                        @SC86158 05265500
  533.          L     15,=X'15000000'                                 @SC86158 05266000
  534.          MVCL  0,14          Fill with NL (X'15')              @SC86158 05266500
  535.          MVI   ICPFL,2       Now intercepting typeout          @SC88026 05267000
  536.          B     RTRN0                                           @SC86295 05267500
  537. * Clean up after interception                                  @SC86295 05268000
  538. ICPFIN   DS    0H                                              @SC89268 05268500
  539. * Restore normal typeout                                                05269000
  540. ICPRST   MVI   ICPFL,0       Tear down                         @SC88026 05269500
  541.          B     RTRN0                                                    05270000
  542. * Execute host command at (R0) with length (R6), unless UCMD set,       05270500
  543. *  in which case string given by SCANPTR                                05271000
  544. SFCHST   TM    FL4,UCMD      User command?                     @SC86295 05271500
  545.          BO    SFCHS0        Yes, scan already set up          @SC86355 05272000
  546.          ST    0,ADR         Set scan string ptrs              @SC86355 05272500
  547.          ST    6,LEN                                           @SC86355 05273000
  548. SFCHS0   LM    0,1,SCANPTR   Get length and adr                @SC87034 05273500
  549.          LTR   6,0           Copy length                       @SC87034 05274000
  550.          BNP   SFCILL        No good                           @SC87034 05274500
  551.          BCTR  6,0                                             @SC87034 05275000
  552.          EX    6,TRUPCAS                                       @SC87034 05275500
  553.          NTOKN N=SFCHBAD                                       @SC88308 05276000
  554.          SCAN  HSTCMDS,RTRN0 Dispatch to handler               @SC88308 05276500
  555. *          Not one of the canned commands, try as CICS         @SC90264 05277000
  556.          MVI   ERRNUM,ERRSYS Say illegal command if failure    @SC90264 05277500
  557.          LA    7,1(,7)       Token length                      @SC90264 05278000
  558.          LA    1,L'SFCPGM    Length of field                   @SC90264 05278500
  559.          CR    7,1           Is it longer than max?            @SC90264 05279000
  560.          BH    RTRNM1        Yes, forbid it                    @SC90264 05279500
  561.          ICM   7,8,BLANK     Prepare for MVCL with padding     @SC90264 05280000
  562.          LA    0,SFCPGM                                        @SC90264 05280500
  563.          MVCL  0,6           Copy to program name buffer       @SC90264 05281000
  564.          ICM   15,15,=A(KHOST)                                 @SC90264 05281500
  565.          BZ    SFCHSX                                          @SC90264 05282000
  566.          LA    0,SFCPGM                                        @SC90264 05282500
  567.          L     1,ADR         String address                    @SC90264 05283000
  568.          LA    2,LEN         Ptr to length                     @SC90264 05283500
  569.          STM   0,2,SFCSECPL  Set up calling sequence           @SC90264 05284000
  570.          KCALL (15),SFCSECPL,EXT,E=RTRNM1                      @SC90264 05284500
  571. SFCHSX   DS    0H                                              @SC90264 05285000
  572.          L     2,ADR         Ptr to remaining string           @SC90264 05285500
  573.          EXEC CICS LINK PROGRAM(SFCPGM) COMMAREA(0(,2)),       @SC90264+05286000
  574.                LENGTH(LEN+2) NOHANDLE,                         @SC91150 05286500
  575.          L     15,DFHEIBP    Set up to copy EIB code           @SC91150 05287000
  576.          CLC   F0,EIBRCODE-DFHEIBLK(15)  Ok?                   @SC91150 05287500
  577.          BNE   RTRNM1        No, say illegal                   @SC91150 05288000
  578.          TM    FSCTRMF,X'80' TTY?                              @SC91150 05288500
  579.          BZ    SFCHSRC       Yes, skip reformatting            @SC91150 05289000
  580.          TM    FL4,UCMD      User cmd?                         @SC91150 05289500
  581.          BZ    SFCHSRC       No, skip reformatting             @SC91150 05290000
  582.          EXEC CICS SEND FROM(ICPSETCC) LENGTH(=Y(ICPSETL)),    @SC91150+05290500
  583.                CTLCHAR(=X'C3') WAIT,  Reformat but don't clear @SC91150 05291000
  584. SFCHSRC  DS    0H                                              @SC91150 05291500
  585.          SR    15,15         Clear RC for now                  @SC90264 05292000
  586.          CLC   =C'R(',0(2)   Is it a return code?              @SC91150 05292500
  587.          BNE   SFCUTZ        No, just use 0                    @SC91150 05293000
  588.          CLI   6(2),C')'     Must be four bytes                @SC91150 05293500
  589.          BNE   SFCUTZ        No, just use 0                    @SC91150 05294000
  590.          CLC   2(1,2),3(2)   Is it small number?               @SC91150 05294500
  591.          BNE   SFCUTZ        No, just use 0                    @SC91150 05295000
  592.          ICM   15,15,2(2)    Ok use that code                  @SC91150 05295500
  593.          B     SFCUTZ        Display return code and return    @SC90264 05296000
  594. *                                                                       05296500
  595. SFCHBAD  MVI   ERRNUM,ERRSYS Illegal system command            @SC90223 05297000
  596.          HELP  HSTCMDS,RTRNM1                                  @SC90223 05297500
  597. *                                                                       05298000
  598. HSTCMDS  KW    'DIRECTORY',SFCDIR,MIN=3                        @SC88308 05298500
  599.          KW    'COPY',SFCCOP,MIN=4                             @SC88308 05299000
  600.          KW    'DELETE',SFCDEL,MIN=3                           @SC88308 05299500
  601.          KW    'RENAME',SFCREN,MIN=3                           @SC88308 05300000
  602.          KW    '&TYPCMD',SFCTYP                                @SC88308 05300500
  603. * ought to implement some on-line help                         @SC90264 05301000
  604.          KW    'any CICS program',0,MIN=99                     @SC90264 05301500
  605.          KW    ,                                               @SC88308 05302000
  606. *                                                                       05302500
  607. SFCDIR   LA    3,13          DISKIO dir function code          @SC88308 05303000
  608.          B     SFCUTL                                          @SC88308 05303500
  609. SFCDEL   LA    3,14          DISKIO del function code          @SC88308 05304000
  610.          B     SFCUTL                                          @SC88308 05304500
  611. SFCREN   LA    3,15          DISKIO ren function code          @SC88308 05305000
  612.          B     SFCUTL                                          @SC88308 05305500
  613. SFCCOP   LA    3,16          DISKIO cop function code          @SC88308 05306000
  614.          B     SFCUTL                                          @SC88308 05306500
  615. SFCTYP   LA    3,17          DISKIO typ function code          @SC88308 05307000
  616. *        B     SFCUTL                                          @SC88308 05307500
  617. SFCUTL   SR    0,0                                             @SC88308 05308000
  618.          KCALL FSPEC,FILNAM,E=SUBERR                           @SC88308 05308500
  619.          CH    3,SFCDEL+2                                      @SC88308 05309000
  620.          BNH   SFCUT1        Dir or del                        @SC88308 05309500
  621.          CH    3,SFCTYP+2                                      @SC88308 05310000
  622.          BE    SFCUT1        Type                              @SC88308 05310500
  623.          SR    0,0                                             @SC88308 05311000
  624.          KCALL FSPEC,IFILE,E=SUBERR Get 2nd file name          @SC88308 05311500
  625. SFCUT1   FTOKN N=SFCUT6      See if anything else in command   @SC88308 05312000
  626.          PTEXT 'No more operands'                              @SC88308 05312500
  627.          B     SUBERR                                          @SC88308 05313000
  628. SFCUT6   LR    0,3           Get function code                 @SC88308 05313500
  629.          LA    2,IFILE       Optional 2nd name                 @SC88308 05314000
  630.          KCALL DISKIO,FILNAM Do it                             @SC88308 05314500
  631. SFCUTZ   DS    0H                                              @SC90264 05315000
  632.          LTR   4,15                                            @SC86295 05315500
  633. * Issue return code msg if needed                              @SC86295 05316000
  634.          BZ    SFCZRC        RC=0                              @SC86158 05316500
  635.          TM    FL4,UCMD      User cmd?                         @SC86316 05317000
  636.          BZ    RTRN          No. No message, just rc in R15    @SC90264 05317500
  637.          MVC   CMD(2),=C'R(' Set up message                    @SC86209 05318000
  638.          LA    15,CMD+2                                        @SC86209 05318500
  639.          BAL   2,EDDEC       Edit RC into msg                  @SC86295 05319000
  640.          MVI   0(15),C')'    Format is R(rc)                   @SC86209 05319500
  641.          LA    0,1(15)                                         @SC86268 05320000
  642.          LA    1,CMD         Start of edited string            @SC86209 05320500
  643.          SR    0,1           Length                            @SC86268 05321000
  644.          WTEXT (1),(0)                                         @SC86268 05321500
  645. SFCZRC   LR    15,4                                            @SC86295 05322000
  646.          MVI   ERRNUM,ERRNOE No errors                         @SC86295 05322500
  647.          B     RTRN                                            @SC86295 05323000
  648. * Unused, system-specific command type                                  05323500
  649. SFCILL   MVI   ERRNUM,ERRSYS Illegal system command            @SC86295 05324000
  650.          B     RTRNM1                                          @SC86295 05324500
  651. *                                                                       05325000
  652. * Retrieve original command line arguments, if any             @SC86295 05325500
  653. *   Return code =0 if yes, =1 if no                            @SC86295 05326000
  654. *   Leave string in CBUF buffer (up to 512), length in CLEN    @SC86295 05326500
  655. SFCLIN   DS    0H                                              @SC89268 05327000
  656.          LH    15,LINLEN     Length of data                    @SC90264 05327500
  657.          LTR   15,15         Anything there?                   @SC86299 05328000
  658.          BNP   RTRN1         Nothing there                     @SC86299 05328500
  659.          L     14,GTLBUFP    Start of data                     @SC90264 05329000
  660.          AR    15,14         End of data                       @SC90264 05329500
  661.          CLI   0(14),SBA     Check for fullscreen buffer adr   @SC90264 05330000
  662.          BNE   *+8                                             @SC90264 05330500
  663.           LA   14,3(,14)     Yes, skip over it                 @SC90264 05331000
  664. SFCLNL1  LA    14,1(,14)     Look for blank after tran id      @SC90264 05331500
  665.          CLI   0(14),C' '                                      @SC90264 05332000
  666.          BE    SFCLNL2       Found it                          @SC90264 05332500
  667.          CR    14,15         Anything left?                    @SC90264 05333000
  668.          BL    SFCLNL1       Yes, keep looking                 @SC90264 05333500
  669. SFCLNL2  DS    0H                                              @SC90264 05334000
  670.          LA    14,1(,14)     Skip over leading blanks, too     @SC90264 05334500
  671.          CLI   0(14),C' '    Leading blanks?                   @SC90264 05335000
  672.          BE    *-8                                             @SC90264 05335500
  673.          SR    15,14         Anything left?                    @SC90264 05336000
  674.          BNP   RTRN1         Nothing there                     @SC86299 05336500
  675.          STM   14,15,GTPBPTRS Save ptrs for GETLIN             @SC91121 05337000
  676.          B     RTRN0                                           @SC86295 05337500
  677. *                                                                       05338000
  678. * Test for stacked commands                                    @SC86295 05338500
  679. *   return code = number of stacked lines                      @SC86295 05339000
  680. SFCSTK   DS    0H            Go to RTRN1 if something stacked  @SC90264 05339500
  681.          ICM   1,15,GTPBPTRS+4 Length stacked for GETLIN       @SC91121 05340000
  682.          BP    RTRN1         Something there, say at least 1   @SC91121 05340500
  683.          B     RTRN0         Nothing stacked                   @SC88095 05341000
  684. *                                                                       05341500
  685. * Log out                                                      @SC86295 05342000
  686. SFCKIL   LR    3,13                                            @SC88026 05342500
  687.          L     3,4(,3)       Look back through save areas      @SC88026 05343000
  688.          CLC   =A(USNTRF),16(3) Find main loop                 @SC89215 05343500
  689.          BNE   *-10                                            @SC88026 05344000
  690.          L     3,8(,3)       Ptr to main save area             @SC88026 05344500
  691.          OI    KFLG-USNTRFSV(3),CMDC Set flag to quit          @SC88026 05345000
  692.          EXEC CICS START TRANSID('CSSF') TERMID(LOGNAM+4),     @SC91150 05345500
  693.          B     RTRN0         Can't do any better               @SC90264 05346000
  694. *                                                                       05346500
  695. * Wait specified time in R0 (sec)                                       05347000
  696. SFCWT    CVD   0,TMPDW       Convert to decimal                @SC90264 05347500
  697.          EXEC CICS DELAY INTERVAL(TMPDW+4),                    @SC90264 05348000
  698. SFCPRP   B     RTRN0         No action for prompting           @SC87351 05348500
  699. *                                                                       05349000
  700. * Return time in centisec in R15                                        05349500
  701. SFCCLK   STCK  TMPDW         Store TOD clock                   @SC89268 05350000
  702.          LM    14,15,TMPDW                                     @SC86295 05350500
  703.          SLDL  14,8          Take mod 204 days                 @SC86295 05351000
  704.          SRDL  14,20         Get in microsec                   @SC86295 05351500
  705.          D     14,=F'10000'  Get in centisec                   @SC86295 05352000
  706.          B     RTRN                                            @SC86295 05352500
  707. *                                                                       05353000
  708.          TITLE 'Typeout interceptor'                                    05353500
  709. * Entry: R1->message buffer, R0=length, R2-> ICPTYP, R15->ret,          05354000
  710. *        R14-R5 saved in ICPRGS.                                        05354500
  711. * Exit:  Message copied to storage.  Registers restored.                05355000
  712.          USING ICPTYP,2                                        @SC89268 05355500
  713. ICPTYP   CLI   ICPFL,2       Intercepting?                     @SC88026 05356000
  714.          BE    ICPGO         Yes, do it                        @SC88026 05356500
  715.          A     0,F3          Allow for SBA                     @SC90264 05357000
  716.          STH   0,GTMLEN      Length of buffer needed           @SC90264 05357500
  717.          EXEC CICS HANDLE CONDITION NOSTG,                     @SC90264 05358000
  718.          EXEC CICS GETMAIN SET(3) LENGTH(GTMLEN),              @SC90264 05358500
  719.          EXEC CICS IGNORE CONDITION LENGERR,                   @SC90264 05359000
  720.          LH    0,GTMLEN      Get length again                  @SC90264 05359500
  721.          LR    4,0                                             @SC90264 05360000
  722.          S     4,F3          Allow for SBA                     @NL90264 05360500
  723.          BCTR  4,0                                             @SC90264 05361000
  724.          L     1,ICPRGS+12   Retrieve ptr to data              @SC90264 05361500
  725.          MVC   3(,3),0(1)    Copy after SBA/CRLF               @SC90264 05362000
  726.          EX    4,*-6                                           @SC90264 05362500
  727.          TM    FSCTRMF,X'80' TTY?                              @SC90264 05363000
  728.          BZ    ICPTT1        Yes                               @SC90264 05363500
  729.          EX    4,ICPTRDSP    Eliminate dangerous characters    @SC90264 05364000
  730.          TM    FSCOTP,X'FF'  Flag for clearing screen?         @SC90264 05364500
  731.          BO    ICPTF1        Yes, reformat it                  @SC90264 05365000
  732.          S     0,F3          Adjust for SBA                    @SC90264 05365500
  733.          AH    0,FSCOTP      Current screen adr                @SC90264 05366000
  734.          CH    0,FSCEND      Will it all fit?                  @SC90264 05366500
  735.          BNH   ICPTF2        Yes, do it                        @SC90264 05367000
  736.          EXEC CICS CONVERSE FROM(ICPMORCC) FROMLENGTH(=Y(ICPMORL)),    +05367500
  737.                CTLCHAR(=X'C3') SET(4) TOLENGTH(FSCOTP),        @SC90264 05368000
  738. ICPTF1   MVC   FSCOTP,FSCBEG                                   @SC90264 05368500
  739.          EXEC CICS SEND FROM(ICPSETCC) LENGTH(=Y(ICPSETL)),    @SC90264+05369000
  740.                CTLCHAR(=X'C3') ERASE WAIT,                     @SC90264 05369500
  741. ICPTF2   LH    0,FSCOTP      Current screen address            @SC90264 05370000
  742.          SRDL  0,6                                             @SC90264 05370500
  743.          SLL   0,2                                             @SC90264 05371000
  744.          SLDL  0,6           Convert to 12/14-bit format       @SC90264 05371500
  745.          STCM  0,3,1(3)                                        @SC90264 05372000
  746.          TR    1(2,3),PRTBLE                                   @SC90264 05372500
  747.          MVI   0(3),SBA      Move to proper adr                @SC90264 05373000
  748.          LA    1,79          Round up to whole line            @SC90264 05373500
  749.          A     1,ICPRGS+8                                      @SC90264 05374000
  750.          SR    0,0                                             @SC90264 05374500
  751.          D     0,=F'80'                                        @SC90264 05375000
  752.          M     0,=F'80'      Convert to address increment      @SC90264 05375500
  753.          CLC   FSCOTP,FSCBEG                                   @SC90264 05376000
  754.          BE    *+8                                             @SC90264 05376500
  755.           AH   1,FSCOTP      Rel. to old adr if not at top     @SC90264 05377000
  756.          STH   1,FSCOTP                                        @SC90264 05377500
  757.          EXEC CICS SEND FROM(0(,3)) LENGTH(GTMLEN) WAIT,       @SC90264+05378000
  758.                CTLCHAR(=X'C2'),                                @SC90264 05378500
  759.          B     ICPTZ         Rejoin                            @SC90264 05379000
  760. ICPTT1   DS    0H            TTY output                        @SC90264 05379500
  761.          MVC   0(3,3),=AL1(CR,LF,XOFF)                         @SC90264 05380000
  762.          EXEC CICS SEND FROM(0(,3)) LENGTH(GTMLEN) WAIT,       @SC90264 05380500
  763. ICPTZ    DS    0H                                              @SC90264 05381000
  764.          EXEC CICS FREEMAIN DATA(0(,3)),                       @NL90264 05381500
  765.          B     ICPTRET                                         @SC87020 05382000
  766. ICPGO    LM    3,4,TXTPTR+4  Output ptrs                       @SC86158 05382500
  767.          SR    4,3           Length left                       @SC86158 05383000
  768.          TM    FSCTRMF,1     Just a prompt?                    @SC90264 05383500
  769.          BO    ICPTRET       Yes, ignore it                    @SC90264 05384000
  770.          LA    15,255        Limit                             @SC86158 05384500
  771.          CLR   15,0          Buffer length                     @SC87020 05385000
  772.          BNH   *+6           Too big                           @SC86158 05385500
  773.           LR   15,0          Ok, use it                        @SC87020 05386000
  774.          LTR   15,15                                           @SC86158 05386500
  775.          BNP   ICPTRET                                         @SC86283 05387000
  776.          CR    15,4          Enough room?                      @SC86283 05387500
  777.          BH    ICPTRET       No                                @SC86283 05388000
  778.          BCTR  15,0          Set up for mvc                    @SC86158 05388500
  779.          EX    15,ICPCOPY    Move to WBUF                      @SC86158 05389000
  780.          LA    3,2(15,3)     New end                           @SC86158 05389500
  781.          ST    3,TXTPTR+4                                      @SC86158 05390000
  782. ICPTRET  LM    14,5,ICPRGS   Restore                           @SC88026 05390500
  783.          NI    FSCTRMF,X'FE' Reset flag                        @SC90264 05391000
  784.          BR    15            Return                            @SC86283 05391500
  785. ICPCOPY  MVC   0(,3),0(1)                                      @SC87020 05392000
  786. ICPTRDSP TR    3(,3),ICPDSP  Convert to safe displayables      @SC90264 05392500
  787.          DROP  2                                                        05393000
  788. * Table of printable equivalents for binary 6-bit numbers      @SC90264 05393500
  789. PRTBLE   DC    C' ',9AL1(*-PRTBLE+192),7AL1(*-PRTBLE+64)       @SC90264 05394000
  790.          DC    9AL1(*-PRTBLE+192),8AL1(*-PRTBLE+64)            @SC90264 05394500
  791.          DC    8AL1(*-PRTBLE+192),6AL1(*-PRTBLE+64)            @SC90264 05395000
  792.          DC    10AL1(*-PRTBLE+192),6AL1(*-PRTBLE+64)           @SC90264 05395500
  793. * Safely displayables                                          @SC90264 05396000
  794. ICPDSP   DC    64C'.',192AL1(*-ICPDSP)                         @SC90264 05396500
  795. *                                                                       05397000
  796. ICPMORCC DC    AL1(SBA),X'5DE9',C'*MORE*'                      @SC90264 05397500
  797. ICPMORL  EQU   *-ICPMORCC                                      @SC90264 05398000
  798. ICPSETCC DC    AL1(SBA),X'5B60',AL1(IC,RTA),X'5DE800'          @SC90264 05398500
  799. ICPERSL  EQU   *-ICPSETCC    Blank cmd line                    @SC90264 05399000
  800.          DC    AL1(SBA),X'4040',AL1(SF),X'60'                  @SC90264 05399500
  801.          DC    AL1(SBA),X'5B5F',AL1(SF),X'40'                  @SC90264 05400000
  802.          DC    AL1(SBA),X'5DE8',AL1(SF),X'60',C'TTYsym'        @SC90264 05400500
  803. ICPSETL  EQU   *-ICPSETCC                                      @SC90264 05401000
  804. *                                                                       05401500
  805.          LOCALS ,                                              @SC86295 05402000
  806. SFCPGM   DS    CL8           Name of program to execute        @SC90264 05402500
  807. SFCSECPL DS    3A            -> (name, string, ->length)       @SC90264 05403000
  808. SUPFNC   EXIT                                                  @SC86158 05403500
  809.          TITLE 'GETLIN Routine - Get a line from terminal'     @SC87015 05404000
  810. * Entry: R1->buffer of length 256                              @SC87015 05404500
  811. * Exit: Buffer filled, R0=length, R15=0 if ok. Else R15=1.     @SC87015 05405000
  812. GETLIN   ENTER                                                 @SC87015 05405500
  813.          LR    8,1           Save buffer ptr                   @SC88095 05406000
  814.          LA    9,256         For copying                       @SC88095 05406500
  815.          LM    6,7,GTPBPTRS  Buffer adr and len                @SC88095 05407000
  816.          LTR   7,7           Already got something?            @SC90264 05407500
  817.          BP    GTL1          Yes, return it                    @SC87015 05408000
  818. GTLRD    LM    0,1,GTLPRPS   Any prompt?                       @SC90264 05408500
  819.          LTR   0,0                                             @SC90264 05409000
  820.          BP    GTLPRMPT                                        @SC90264 05409500
  821.          PTEXT ' ',AREG=1,LREG=0                               @SC90264 05410000
  822. GTLPRMPT OI    FSCTRMF,1     Responsive                        @SC90264 05410500
  823.          BAL   15,WTEXT                                        @SC90264 05411000
  824.          EXEC CICS RECEIVE SET(6) LENGTH(GTMLEN) ASIS,         @SC90264 05411500
  825.          L     0,GTLBUFP                                       @SC90264 05412000
  826.          LA    1,256         Length of my buffer               @SC90264 05412500
  827.          LH    7,GTMLEN      Length of data                    @SC90264 05413000
  828.          CR    1,7                                             @SC90264 05413500
  829.          BNH   *+6                                             @SC90264 05414000
  830.           LR   1,7                                             @SC90264 05414500
  831.          STM   0,1,GTPBPTRS  Buffer adr and len                @SC90264 05415000
  832.          MVCL  0,6           Copy input stuff to buffer        @SC90264 05415500
  833.          LM    6,7,GTPBPTRS  Get adr and len again             @SC90264 05416000
  834.          L     DFHEIBR,DFHEIBP  Get ptr to data block          @SC90264 05416500
  835.          USING DFHEIBLK,DFHEIBR                                @SC90264 05417000
  836.          TM    FSCTRMF,X'80' TTY?                              @SC90264 05417500
  837.          BZ    GTLRDT        Yes, skip fullscreen stuff        @SC90264 05418000
  838.          CLI   EIBAID,X'6D'  CLEAR?                            @SC90264 05418500
  839.          BNE   GTLRDF2       No, use it                        @SC90264 05419000
  840.          MVI   FSCOTP,X'FF'  Flag for reformatting             @SC90264 05419500
  841.          B     GTLRD                                           @SC90264 05420000
  842.          DROP  DFHEIBR                                         @SC90264 05420500
  843. GTLRDF2  A     6,F3          Space over SBA                    @SC90264 05421000
  844.          S     7,F3                                            @SC90264 05421500
  845.          LR    1,6           Copy command address              @SC90264 05422000
  846.          LTR   0,7           Anything there?                   @SC90264 05422500
  847.          BNM   GTLRDF3       Yes, ok                           @SC90264 05423000
  848.          PTEXT ' ',AREG=1,LREG=0 No, display blanks            @SC90264 05423500
  849. GTLRDF3  OI    FSCTRMF,1     Indicate just copying             @SC90264 05424000
  850.          BAL   15,WTEXT                                        @SC90264 05424500
  851.          L     2,=A(ICPSETCC)   Ptr to command string          @SC90264 05425000
  852.          EXEC CICS SEND FROM(0(,2)) LENGTH(=Y(ICPERSL)) WAIT,  @SC90264+05425500
  853.                CTLCHAR(=X'C3'),                                @SC90264 05426000
  854. GTLRDT   DS    0H                                              @SC90264 05426500
  855. GTL1     LTR   2,7           Length of text remaining          @SC88095 05427000
  856.          BNP   GTLFRE        None, return length 0             @SC88095 05427500
  857.          LA    0,0(7,6)      End of buffer                     @SC88095 05428000
  858.          SR    4,4                                             @SC88095 05428500
  859.          IC    4,LNDLM       Get delimiter                     @SC88095 05429000
  860.          LA    4,TRTBL(4)    Ptr to delimiter char             @SC88095 05429500
  861.          MVI   0(4),1        Set up to snag delims             @SC88095 05430000
  862.          MVI   TRTBL+C' ',0  And ignore blanks                 @SC88095 05430500
  863.          CR    2,9           Get shorter of 256 and string     @SC88095 05431000
  864.          BNH   *+6                                             @SC88095 05431500
  865.           LR   2,9                                             @SC88095 05432000
  866.          LA    1,0(2,6)      End, in case no delim found       @SC88095 05432500
  867.          BCTR  2,0           Set up for EX                     @SC88095 05433000
  868.          EX    2,GTLTRT                                        @SC88095 05433500
  869.          MVI   0(4),0        Now clear out table               @SC88095 05434000
  870.          MVI   TRTBL+C' ',1  And restore                       @SC88095 05434500
  871.          SR    1,6           Length of line                    @SC88095 05435000
  872.          LR    7,1           Set up MVCL                       @SC88095 05435500
  873.          CR    9,7           Get shorter of 256 and string     @SC88095 05436000
  874.          BNH   *+6                                             @SC88095 05436500
  875.           LR   9,7                                             @SC88095 05437000
  876.          LR    2,9           Length actually copied            @SC88095 05437500
  877.          MVCL  8,6                                             @SC88095 05438000
  878.          AR    6,7           In case we couldn't use it all    @SC88095 05438500
  879.          LA    6,1(,6)       Skip over linend char             @SC88095 05439000
  880.          LR    7,0                                             @SC88095 05439500
  881.          SR    7,6           New buffer length                 @SC88095 05440000
  882. GTLFRE   DS    0H                                              @SC90264 05440500
  883.          STM   6,7,GTPBPTRS                                    @SC88095 05441000
  884. GTLZ     RETREG (0,2)        Return (2) as R0                  @SC89218 05441500
  885.          B     RTRN0                                           @SC87015 05442000
  886. GTLTRT   TRT   0(,6),TRTBL   Find a delimiter                  @SC88095 05442500
  887.          LOCALS ,                                              @SC87015 05443000
  888. GETLIN   EXIT  ,                                               @SC87015 05443500
  889.          TITLE 'TERMIO Routine - Handle terminal I/O'                   05444000
  890. * R1 points to a pair of (adr,len) for read or write.  If I/O is        05444500
  891. * successfull, R15 returns transferred byte count (else returns -1).    05445000
  892. *               Command code is in R0:                                  05445500
  893. * 1 => Open line for I/O            4 => Write packet                   05446000
  894. * 2 => Close line                   5 => Read packet                    05446500
  895. * 3 => Reset line status after    ( 6 => Write message ) not used       05447000
  896. *      environment changes                                              05447500
  897. *                                                                       05448000
  898. TERMIO   ENTER                                                          05448500
  899.          SR    15,15         OK                                @SC86295 05449000
  900.          BCT   0,TRMCLS                                        @SC86295 05449500
  901. * Open terminal line for protocol                                       05450000
  902. *                            Ignore attention interrupts       @SC90264 05450500
  903.          MVI   RIOC,X'80'    Nothing saved                     @SC86295 05451000
  904.          MVI   TRMFLG,X'FF'  Initialize w/r flag               @SC87275 05451500
  905.          B     RTRN0                                           @SC86295 05452000
  906. * Close terminal line after protocol transfer                           05452500
  907. TRMCLS   BCT   0,TRMRSET                                       @SC86295 05453000
  908. *                                                              @SC90264 05453500
  909.          B     RTRN0                                           @SC86295 05454000
  910. * (Re)set terminal characteristics to suit environment                  05454500
  911. TRMRSET  BCT   0,TRMRW                                         @SC86295 05455000
  912.          B     RTRN0                                           @SC86295 05455500
  913. *                                                                       05456000
  914. *  Perform I/O request                                                  05456500
  915. TRMRW    LR    8,1           Save ptr to plist                 @SC90264 05457000
  916.          LM    2,3,0(8)      Get address and length            @SC90264 05457500
  917.          BCT   0,TRMRD                                         @SC87015 05458000
  918.          CLI   WRRD,0        Write/read?                       @SC87275 05458500
  919.          BNE   *+8           Yes                               @SC87275 05459000
  920.          MVI   TRMFLG,0      Indicate no action on follow-up   @SC87275 05459500
  921.          STH   3,GTMLEN      Set up length                     @SC90264 05460000
  922.          EXEC CICS SEND FROM(0(,2)) LENGTH(GTMLEN) WAIT,       @SC90264 05460500
  923.          B     RTRN0                                           @SC87317 05461000
  924. *                                                                       05461500
  925. * Read from terminal                                                    05462000
  926. TRMRD    TS    TRMFLG                                          @SC87275 05462500
  927.          BZ    RTRN0         Just a follow-up. 0-length read   @SC87275 05463000
  928.          LM    2,3,0(8)      Our buffer's adr and length       @SC90264 05463500
  929.          STH   3,GTMLEN                                        @SC90264 05464000
  930.          EXEC CICS HANDLE CONDITION LENGERR(RTRNM1),           @SC90264 05464500
  931.          EXEC CICS RECEIVE INTO(0(,2)) LENGTH(GTMLEN) ASIS,    @SC90264 05465000
  932.          LH    15,GTMLEN     Get length for return             @SC90264 05465500
  933.          B     RTRN                                            @SC90264 05466000
  934.          LOCALS ,                                              @SC86295 05466500
  935.          EXIT                                                           05467000
  936.          TITLE 'SCRNIO Routine - Handle screen I/O via Series/1'        05467500
  937. * R1 points to a pair of (adr,len) for read or write.  If I/O is        05468000
  938. * successfull, R15 returns transferred byte count (else returns -1).    05468500
  939. *               Command code is in R0:                                  05469000
  940. * 0 => Clear screen on console (not comm line)                 @SC90045 05469500
  941. * 1 => Open screen for I/O            4 => Write packet (gets ATTN)     05470000
  942. * 2 => Close line                     5 => Read packet                  05470500
  943. * 3 => Reset screen status after      6 => Write message (no ATTN)      05471000
  944. *      environment changes            7 => Read screen buffer           05471500
  945. *                                                                       05472000
  946. SCRNIO   ENTER                                                          05472500
  947.          LA    8,SCRPLST     Get PLST ptr                      @SC90222 05473000
  948.          LTR   0,0                                             @SC90045 05473500
  949.          BZ    SCRCLR                                          @SC90045 05474000
  950.          LR    6,1           Save ptr to plist                 @SC90222 05474500
  951.          STC   0,CONSOPR     Save command code                 @LP88158 05475000
  952.          BCT   0,SCRCLS                                        @SC86295 05475500
  953. * Set up for transparent I/O                                            05476000
  954.          L     1,=A(IDEFS)   CSECT of initializations          @SC90173 05476500
  955.          USING DEFS,1        Mapped via DSECT                  @SC90173 05477000
  956.          LA    2,S1DATA      Series/1 introducer               @SC90173 05477500
  957.          LA    3,S1ORDL+2    Length + 2                        @SC90173 05478000
  958.          CLI   TRMTP,C'S'                                      @SC90173 05478500
  959.          BE    SCRPRSET      Do it                             @SC90173 05479000
  960.          LA    2,GRDATA      Graphics introducer               @SC90173 05479500
  961.          LA    3,GRDL+2      Length + 2                        @SC90173 05480000
  962.          CLI   TRMTP,C'G'                                      @SC90173 05480500
  963.          BE    SCRPRSET      Do it                             @SC90173 05481000
  964.          LA    2,AEADAT      AEA introducer                    @SC90173 05481500
  965.          LA    3,AEAL+2                                        @SC90173 05482000
  966.          DROP  1                                               @SC90173 05482500
  967. SCRPRSET LR    5,3                                             @SC90173 05483000
  968.          LA    4,S1EOL+2     Get start of command buffer       @SC90173 05483500
  969.          SR    4,5                                             @SC90173 05484000
  970.          STM   4,5,S1XOPL    Set up prompt plist               @SC90173 05484500
  971.          S     5,F2          Deduct stuff already there        @SC90173 05485000
  972.          MVCL  4,2                                             @SC90173 05485500
  973. *        MVI   SCRLST,0      Clear op code                     @SC88091 05486000
  974.          MVI   RIOC,X'80'    Nothing saved                     @SC86295 05486500
  975. *                            Full-screen mode                  @SC90264 05487000
  976.          B     SCRCLRX                                         @SC90045 05487500
  977. SCRCLR   CLI   TRMTP,C'T'    Is it a TTY terminal?             @SC90045 05488000
  978.          BE    RTRN0         Yes, can't clear screen           @SC90045 05488500
  979.          CLI   TRMTP,C'V'    Is it a TTY terminal?             @SC90045 05489000
  980.          BE    RTRN0         Yes, can't clear screen           @SC90045 05489500
  981.          TM    FL2,PROTO     In protocol mode?                 @SC90045 05490000
  982.          BO    RTRN0         Yes, skip clearing screen         @SC90045 05490500
  983. SCRCLRX  LA    8,SCRCCWCL    Clear-screen plist                @SC90045 05491000
  984.          BAL   9,SCRNEX      Do it                             @SC90045 05491500
  985.          MVI   FSCOTP,X'FF'  Flag for clearing                 @SC90264 05492000
  986.          B     RTRN0                                           @SC86295 05492500
  987. SCRCCWCL DC    C'E',AL3(0),XL4'0'  Erasure                     @SC90264 05493000
  988. *                                                                       05493500
  989. * Clean up after I/O                                                    05494000
  990. SCRCLS   BCT   0,SCRRSET                                       @SC86295 05494500
  991.          B     SCRCLRX       Clear screen                      @SC90045 05495000
  992. *                                                                       05495500
  993. * (Re)set device characteristics to suit environment                    05496000
  994. SCRRSET  BCT   0,SCRRW                                         @SC86295 05496500
  995.          B     RTRN0                                                    05497000
  996. *                                                                       05497500
  997. *  Perform I/O request                                                  05498000
  998. * R6-> (adr,len); R0=1 if write, 2 if read, 3 if message.      @SC90264 05498500
  999. SCRRW    DS    0H                                              @SC90222 05499000
  1000.          MVC   0(8,8),0(6)   Copy plist                        @SC90264 05499500
  1001.          STC   0,0(,8)       Set operation code (arbitrary)    @SC90264 05500000
  1002.          CLI   TRMTP,C'A'    AEA?                              @SC90264 05500500
  1003.          BNE   *+8           No, use those codes               @SC90264 05501000
  1004.           OI   0(8),X'80'    Mark this different               @SC90264 05501500
  1005.          BAL   9,SCRNEX      Execute internal subr             @SC86295 05502000
  1006.          TM    CONSOPR,1     Read request?                     @SC90264 05502500
  1007.          BO    SCRRDZ        Yes, get length                   @SC90264 05503000
  1008.          ICM   1,15,SCRRC    Check return code                 @SC90222 05503500
  1009.          BNZ   RTRNM1        If error, say so                  @SC90222 05504000
  1010.          B     RTRN0         Return                            @SC86299 05504500
  1011. SCRRDZ   LR    15,5                                            @LP88186 05505000
  1012.          S     15,WRCMDL+4   Deduct 3 for buffer adr           @SC90173 05505500
  1013.          B     RTRN          Return                            @SC86299 05506000
  1014. *                                                                       05506500
  1015. * SCRLOG: Hexadecimal log of (R2) bytes at address (R1)        @LP88158 05507000
  1016. * Log label is taken from R0 low order byte.                   @SC89166 05507500
  1017. * Return via R7.  R0-R3 and R15 destroyed.                     @SC89166 05508000
  1018. SCRLOG   TM    FL1,DEBUG     Logging in effect?                @SC87286 05508500
  1019.          BZR   7             No, that's all                    @SC89166 05509000
  1020.          TM    DBGFLG,DBGIO  I/O stuff requested?              @SC88168 05509500
  1021.          BZR   7             No, skip it                       @SC89166 05510000
  1022.          L     3,LOGBUF      Ptr to buffer                     @LP88158 05510500
  1023.          STC   0,0(,3)       Set log label                     @SC89166 05511000
  1024.          LA    3,2(,3)       Start of data area                @SC91172 05511500
  1025.          TM    DBGFLG,DBGTI  Times requested?                  @SC91172 05512000
  1026.          BZ    SCRLOGA       No, just do hex dump              @SC91172 05512500
  1027.          ST    1,SCRLR1      Save ptr to block                 @SC91172 05513000
  1028.          BAL   14,ACCTTOD    Get time of day in seconds        @SC91172 05513500
  1029.          MVI   0(3),C' '     Leave a space                     @SC91172 05514000
  1030.          KCALL DUMPTOD,1(3)  Format time into buffer           @SC91172 05514500
  1031.          LR    3,15          Get ptr to end of string          @SC91172 05515000
  1032.          L     1,SCRLR1      Restore R1                        @SC91172 05515500
  1033. SCRLOGA  LA    0,6*9(,3)     End of line buffer                @SC91172 05516000
  1034.          TM    DBGFLG,DBGLO  Long buffer requested?            @SC90222 05516500
  1035.          BZ    *+8                                             @SC90222 05517000
  1036.           LA   0,50*9(,3)    Yes, long buffer                  @SC91172 05517500
  1037. SCRLOGLP MVI   0(3),C' '     Add for readability               @LP88158 05518000
  1038.          UNPK  1(9,3),0(5,1) Unpack into buffer                @SC88168 05518500
  1039.          TR    1(8,3),TRHEX  Convert to printable hex          @SC88168 05519000
  1040.          LA    3,9(3)        Advance text ptr                  @SC88168 05519500
  1041.          LA    1,4(1)        and data source                   @LP88158 05520000
  1042.          S     2,F4          Finished data?                    @SC88168 05520500
  1043.          BNP   SCRLGEND      Yes, go write                     @LP88158 05521000
  1044.          CR    3,0           Reached text limit?               @LP88158 05521500
  1045.          BL    SCRLOGLP      no, loop for more slices          @LP88158 05522000
  1046.          MVC   0(3,3),=C'...' Show incomplete                  @LP88158 05522500
  1047.          LA    3,3(3)                                          @SC88168 05523000
  1048. SCRLGEND DS    0H                                              @LP88158 05523500
  1049.          AR    2,2           Check for incomplete slice        @SC88168 05524000
  1050.          BNM   *+6           No, ok                            @SC88168 05524500
  1051.          AR    3,2           Yes, adjust end of text           @SC88168 05525000
  1052.          S     3,LOGBUF      Get length of text                @SC88168 05525500
  1053.          WRITF LOGPTR,BSIZE=(3) Log it                         @LP88158 05526000
  1054.          TM    DBGFLG,DBGSV  SAVE requested?                   @SC88168 05526500
  1055.          BZR   7             No, skip closing log file         @SC89166 05527000
  1056.          SAVEF LOGPTR        Update disk directory             @SC88168 05527500
  1057.          BR    7                                               @SC89166 05528000
  1058. *                                                                       05528500
  1059. *----- perform screen I/O operation, add to debug log ---------@SC90264 05529000
  1060. * Entry: R8-> X'code',AL3(adr),F'length', R9-> return          @SC90264 05529500
  1061. * Exit: uses 0,1,2,3,5,7,14; data length in R15 or -1 if error @SC90264 05530000
  1062. SCRNEX   LR    1,8           Get plist ptr                     @SC90222 05530500
  1063.          SLR   2,2           Convert op. code to log label     @LP88158 05531000
  1064.          IC    2,CONSOPR                                       @LP88158 05531500
  1065.          LA    2,CONSOPRS(2)                                   @LP88158 05532000
  1066.          IC    0,0(,2)                                         @SC89166 05532500
  1067.          LA    2,8           Size of plist                     @SC90264 05533000
  1068.          BAL   7,SCRLOG      Log it                            @SC90222 05533500
  1069.          LM    2,3,0(8)      Data ptr and len                  @SC90264 05534000
  1070.          TM    0(8),1        Write of some sort?               @SC90264 05534500
  1071.          BZ    SCRNEXR       No, read                          @SC90264 05535000
  1072. *          Write...                                            @SC90264 05535500
  1073.          STH   3,GTMLEN      Length of buffer needed           @SC90264 05536000
  1074.          LR    5,3           Save for logging                  @SC90264 05536500
  1075.          CLI   0(8),C'E'     Clear screen?                     @SC90264 05537000
  1076.          BNE   SCRNEXW0      No                                @SC90264 05537500
  1077.          EXEC CICS SEND CONTROL ERASE FREEKB,  Yes, do it      @NL90264 05538000
  1078.          B     SCRNEXW2                                        @SC90264 05538500
  1079. SCRNEXW0 DS    0H                                              @SC90264 05539000
  1080.          CLI   0(8),X'81'    WRITE STRUCTURED FIELD?           @SC90264 05539500
  1081.          BNE   SCRNEXW1      No, just WRITE                    @SC90264 05540000
  1082.          EXEC CICS SEND STRFIELD WAIT FROM(0(,2)) LENGTH(GTMLEN),       05540500
  1083.          B     SCRNEXW2                                        @SC90264 05541000
  1084. SCRNEXW1 DS    0H                                              @SC90264 05541500
  1085.          MVI   SCRCTLCH,X'C2'  Unlock kbd normally             @SC91039 05542000
  1086.          CLI   CONSOPR,6       Write message?                  @SC91039 05542500
  1087.          B     *+8    (BNE)  $$$$$$$$ for now $$$$$$$$         @SC91039 05543000
  1088.           MVI  SCRCTLCH,X'C1'  Yes, lock it to prevent clash   @SC91039 05543500
  1089.          EXEC CICS SEND WAIT FROM(0(,2)) LENGTH(GTMLEN),       @SC91039+05544000
  1090.                CTLCHAR(SCRCTLCH),                              @SC91039 05544500
  1091. SCRNEXW2 DS    0H                                              @SC90264 05545000
  1092.          B     SCRNEXZ                                         @SC90264 05545500
  1093. *          Read...                                             @SC90264 05546000
  1094. SCRNEXR  LA    5,3           Normal length: AID + cursor adr   @SC91150 05546500
  1095.          CLI   SCRLSTIO,X'81'  WRT STR FLD?                    @SC91150 05547000
  1096.          BNE   *+8           No, fine                          @SC91150 05547500
  1097.           LA   5,1           Yes, expect only the AID          @SC91150 05548000
  1098.          SR    3,5                                             @SC91150 05548500
  1099.          STH   3,GTMLEN      Length of buffer needed           @SC90264 05549000
  1100.          LA    7,0(5,2)      Ptr to data portion               @SC91150 05549500
  1101.          EXEC CICS HANDLE CONDITION LENGERR(RTRNM1),           @SC90264 05550000
  1102.          CLI   CONSOPR,7                                       @SC90264 05550500
  1103.          BE    SCRNEXR1                                        @SC90264 05551000
  1104.          EXEC CICS RECEIVE INTO(0(,7)) LENGTH(GTMLEN) ASIS,    @SC91150 05551500
  1105.          B     SCRNEXR2                                        @SC90264 05552000
  1106. SCRNEXR1 EXEC CICS RECEIVE INTO(0(,7)) LENGTH(GTMLEN) ASIS,    @SC91150+05552500
  1107.                BUFFER,                                         @SC90264 05553000
  1108. SCRNEXR2 DS    0H                                              @SC90264 05553500
  1109.          L     DFHEIBR,DFHEIBP                                 @SC90264 05554000
  1110.          USING DFHEIBLK,DFHEIBR                                @SC90264 05554500
  1111.          MVC   0(1,2),EIBAID Reconstruct data stream           @SC90264 05555000
  1112.          C     5,F1                                            @SC91150 05555500
  1113.          BNH   *+10                                            @SC91150 05556000
  1114.          MVC   1(2,2),EIBCPOSN  in our buffer                  @SC90264 05556500
  1115.          DROP  DFHEIBR                                         @SC90264 05557000
  1116.          AH    5,GTMLEN      Data length reconstructed         @SC91150 05557500
  1117. SCRNEXZ  SR    15,15         For now...                        @SC90264 05558000
  1118. SCRNEXZZ ST    15,SCRRC                                        @SC90222 05558500
  1119.          MVC   SCRLSTIO,0(8) Save code of last I/O             @SC91150 05559000
  1120.          LTR   15,15                                           @SC90222 05559500
  1121.          BZ    SCRNEXD       Ok, log data                      @SC90222 05560000
  1122.          LA    1,SCRRC                                         @SC90222 05560500
  1123.          LA    2,4                                             @SC90222 05561000
  1124.          LA    0,C'e'        "Error" label                     @SC90222 05561500
  1125.          BAL   7,SCRLOG      Log the return code               @SC90222 05562000
  1126. SCRNEXD  L     1,0(,8)       Data address                      @SC90222 05562500
  1127.          LA    0,C'd'        "Data" label                      @SC89166 05563000
  1128.          LR    2,5           Data size                         @SC90222 05563500
  1129.          BAL   7,SCRLOG      Log data                          @SC90222 05564000
  1130.          LR    15,5                                            @LP88186 05564500
  1131.          BR    9             Return to caller                  @LP88186 05565000
  1132. *                                                                       05565500
  1133. CONSOPRS DC    C'?ocswrmg'   Console command labels for log    @SC91150 05566000
  1134.          LOCALS ,                                              @SC86299 05566500
  1135. SCRPLST  DS    2F            Control block                     @SC90264 05567000
  1136. SCRRC    DS    F             Return code from PUT/GET          @SC90222 05567500
  1137. SCRLR1   DS    F             Saved R1 in SCRLOG                @SC91172 05568000
  1138. CONSOPR  DS    XL1           Current I/O operation             @SC89180 05568500
  1139. SCRCTLCH DS    X             WCC for next output op            @SC91039 05569000
  1140. SCRNIO   EXIT  ,                                               @SC86299 05569500
  1141.          TITLE 'SETMSG Routine - controls CP breakin'                   05570000
  1142. * Entry: R1 selects operation                                           05570500
  1143. * Exit: R15=0 if ok                                                     05571000
  1144. * 1-> Analyze user environment, determine if suitable.                  05571500
  1145. *     Save quantities needed and condition line for entering commands.  05572000
  1146. *     Perform any system-dependent initialization.                      05572500
  1147. * 2-> Condition line for protocol transfers.                            05573000
  1148. * 3-> Decondition line at end of transfer.                              05573500
  1149. * 4-> System-dependent clean-up at exit.                                05574000
  1150. * 5-> Reperform system-dependent initialization after SET LINE.         05574500
  1151. *                                                                       05575000
  1152. IC       EQU   X'13'         Insert Cursor                     @SC90264 05575500
  1153. SF       EQU   X'1D'         Start Field                       @SC90264 05576000
  1154. SETMSG   ENTER ,                                               @SC87015 05576500
  1155.          BCT   1,STM2                Go if R1 not 1, so no init         05577000
  1156.          OI    FL1,REN       Set "WARN" ON                     @SC90264 05577500
  1157.          MVI   CLSNFL,C'R'   (both ways)                       @SC90264 05578000
  1158.          MVI   DESTL+1,1     Set to default                    @SC90264 05578500
  1159.          MVI   DEST,C'*'                                       @SC90264 05579000
  1160.          EXEC CICS ADDRESS CSA(1),                             @SC90264 05579500
  1161.          ST    1,CSAPTR      Save ptr to CSA                   @SC90264 05580000
  1162.          L     15,CSATSATA-DFHCSABA(,1)                        @SC91150 05580500
  1163.          USING DFHTSMAP,15                                     @SC91150 05581000
  1164.          MVC   KTSBPSEG,TSMBPSEG Log(seg size)                 @SC91150 05581500
  1165.          MVC   KTSGIDNE,TSMGIDNE Number of entries per TSGID   @SC91150 05582000
  1166.          DROP  15                                              @SC91150 05582500
  1167.          EXEC CICS ASSIGN,                                     @SC90264.05583000
  1168.                OPID(COPID),                                    @LM90264.05583500
  1169.                SYSID(CSYSID),                                  @LM90264.05584000
  1170.                SCRNHT(CSCRNHT),                                @LM90264.05584500
  1171.                SCRNWD(CSCRNWD),                                @LM90264.05585000
  1172.                TERMCODE(TCTTETT),                              @SC90264 05585500
  1173.          CLI   TCTTETT,X'40' TTY?                              @SC90264 05586000
  1174.          BL    *+8           Yes                               @SC90264 05586500
  1175.           OI   FSCTRMF,X'80' No, mark it fullscreen            @SC90264 05587000
  1176.          L     DFHEIBR,DFHEIBP                                 @SC90264 05587500
  1177.          USING DFHEIBLK,DFHEIBR                                @SC90264 05588000
  1178.          MVC   LOGNAM+4(4),EIBTRMID  Copy termid for uniqueness@SC90264 05588500
  1179.          MVC   REPNAM+4(4),EIBTRMID  Ditto                     @SC90264 05589000
  1180.          ICM   2,15,DFHEICAP Any comm area?                    @SC90264 05589500
  1181.          BZ    STM1REC       No, issue a read                  @SC90264 05590000
  1182.          LH    1,EIBCALEN    Length of comm area?              @SC90264 05590500
  1183.          LTR   1,1                                             @SC90264 05591000
  1184.          BZ    STM1REC       Zero, issue a read                @SC90264 05591500
  1185.          CH    1,=H'256'     Max allowed in buffer             @SC91150 05592000
  1186.          BNH   *+8                                             @SC91150 05592500
  1187.           LH   1,=H'256'     Use max for length                @SC91150 05593000
  1188.          STH   1,LINLEN      Ok, use the commarea as command   @SC90264 05593500
  1189.          LR    3,1           Set up MVCL                       @SC91150 05594000
  1190.          L     0,GTLBUFP                                       @SC91150 05594500
  1191.          MVCL  0,2           Copy string to input cmd buffer   @SC91150 05595000
  1192.          B     STM1RECZ      Done setup of command             @SC90264 05595500
  1193.          DROP  DFHEIBR                                         @SC90264 05596000
  1194. STM1REC  DS    0H                                              @SC90264 05596500
  1195.          MVC   LINLEN,=H'256'                                  @SC90264 05597000
  1196.          L     2,GTLBUFP     Get invocation buffer             @SC90264 05597500
  1197.          EXEC CICS IGNORE CONDITION LENGERR,                   @SC90264 05598000
  1198.          EXEC CICS RECEIVE INTO(0(,2)) LENGTH(LINLEN) ASIS,    @SC90264 05598500
  1199. STM1RECZ DS    0H                                              @SC90264 05599000
  1200.          MVI   FSCOTP,X'FF'  Flag for reformatting fullscreen  @SC90264 05599500
  1201.          L     2,QFNBP       Ptr to ring of QFN buffers        @SC90264 05600000
  1202.          ST    2,QFNPTR      1st buffer to use                 @SC90264 05600500
  1203.          LA    3,3-1         Number - 1 of buffers             @SC90264 05601000
  1204.          LA    4,QFNSIZ+4(,2) Chain together                   @SC90264 05601500
  1205.          STCM  4,15,QFNSIZ(2)                                  @SC90264 05602000
  1206.          LR    2,4                                             @SC90264 05602500
  1207.          BCT   3,*-10        Loop over buffers                 @SC90264 05603000
  1208.          MVC   QFNSIZ(4,2),QFNPTR Complete the ring            @SC90264 05603500
  1209.          SETUSER ,                                             @SC90264 05604000
  1210.          KCALL KFLCWD,DESTL                                    @SC90264 05604500
  1211.          B     STM5X                                           @SC90173 05605000
  1212. *                                                                       05605500
  1213. STM2     BCT   1,STM3                Go if R1 was not 2, so not off     05606000
  1214. *                                                              @SC90264 05606500
  1215.          TM    FL1,TSTF                                        @SC86295 05607000
  1216.          BO    RTRN0         Just testing, don't change it     @SC86295 05607500
  1217. *                                                              @SC90264 05608000
  1218.          B     STMD                                                     05608500
  1219. *                                                                       05609000
  1220. STM3     BCT   1,STM4                                          @SC86316 05609500
  1221. *                                                              @SC90264 05610000
  1222. STMD     DS    0H                                              @SC86316 05610500
  1223.          B     RTRN0                                                    05611000
  1224. *                                                                       05611500
  1225. STM4     BCT   1,STM5        Special clean-up                  @SC87351 05612000
  1226.          SR    0,0                                             @SC90264 05612500
  1227.          KCALL SCRNIO        Clear screen if fullscreen        @SC90264 05613000
  1228.          TM    DSKFL,PLOAD   Pgm loaded?                       @SC90264 05613500
  1229.          BZ    STM4A                                           @SC90264 05614000
  1230.          EXEC CICS RELEASE PROGRAM('IKXDYNAL') NOHANDLE,       @SC90264 05614500
  1231. STM4A    DS    0H                                              @SC90264 05615000
  1232.          KCALL KFLCWD,F0     Free all megablocks               @SC90264 05615500
  1233.          B     RTRN0         Special clean-up done             @SC87296 05616000
  1234. *                                                                       05616500
  1235. STM5     DS    0H            Re-init after SET LINE            @SC87351 05617000
  1236.          MVI   TRMTP,C'N'    Assume bad until validated        @SC90173 05617500
  1237.          CLI   TRMLIN,C' '   External line?                    @SC87351 05618000
  1238.          BE    STM5X         No, use terminal                  @SC90173 05618500
  1239.          B     RTRN1         Other lines not allowed           @SC90173 05619000
  1240. STM5X    DS    0H            Now set up controller type        @SC90173 05619500
  1241.          MVI   TRMTP,C'&KCONT'  1st assume TTY                 @SC88309 05620000
  1242.          TM    FSCTRMF,X'80' TTY?                              @SC90264 05620500
  1243.          BZ    STMSTY        Yes                               @SC86299 05621000
  1244.          MVC   WRCMDL+4(4),F3  Preset the length to skip       @SC91150 05621500
  1245.          MVI   TRMTP,C'S'    Remember going via S/1            @SC87166 05622000
  1246.          L     8,RIOPTRS                                       @SC90173 05622500
  1247.          XC    0(9,8),0(8)   Zero out buffer                   @SC88203 05623000
  1248.          LA    0,1                                             @SC88203 05623500
  1249.          KCALL SCRNIO        Clear screen and set up           @SC88203 05624000
  1250.          LA    0,6                                             @SC88203 05624500
  1251.          KCALL SCRNIO,STMS1ST,E=(STM5SC,M) Issue status request@SC90173 05625000
  1252.          LA    0,7                                             @SC90264 05625500
  1253.          KCALL SCRNIO,RIOPTRS,E=(STM5SC,NP) Read back screen   @SC91150 05626000
  1254.          CLC   =X'5BBC',4(8)                                   @SC90264 05626500
  1255.          BE    STM5SC        String appeared on screen, not S1 @SC91150 05627000
  1256.          LA    0,6                                             @SC91150 05627500
  1257.          KCALL SCRNIO,STMS1STI,E=(STM5SC,M) Again, with intrpt.@SC91150 05628000
  1258.          LA    0,5                                             @SC91150 05628500
  1259.          KCALL SCRNIO,RIOPTRS Read back screen                 @SC91150 05629000
  1260. STM5SC   DS    0H                                              @SC90173 05629500
  1261.          LA    0,2                                             @SC88203 05630000
  1262.          KCALL SCRNIO        Release screen                    @SC88203 05630500
  1263.          CLI   0(8),X'E4'    Check for Yale status response    @SC88203 05631000
  1264.          BE    *+12          Ok, I trust                       @SC88294 05631500
  1265.           CLI  0(8),0        Other possibility                 @SC88294 05632000
  1266.           BNE  STMGRP        No, must be something else        @SC88294 05632500
  1267.          CLI   3(8),X'11'                                      @SC88203 05633000
  1268.          BNE   STMGRP        No, must be something else        @SC88203 05633500
  1269.          CLC   =X'2B5B5B',6(8)                                 @SC88203 05634000
  1270.          BE    RTRN0         Yes, all set                      @SC88203 05634500
  1271. STMGRP   MVI   TRMTP,C'A'    Assume AEA device                 @SC90173 05635000
  1272.          L     8,RIOPTRS                                       @SC90173 05635500
  1273.          XC    0(9,8),0(8)   Zero out buffer                   @SC90173 05636000
  1274.          LA    0,1                                             @SC90173 05636500
  1275.          KCALL SCRNIO        Clear screen and set up           @SC90173 05637000
  1276.          LA    0,4                                             @SC90173 05637500
  1277.          KCALL SCRNIO,STMAEAST,E=(STM5AC,M) Issue Read Part'n  @SC90173 05638000
  1278.          LA    0,5                                             @SC90173 05638500
  1279.          KCALL SCRNIO,RIOPTRS Read back status                 @SC90173 05639000
  1280. STM5AC   DS    0H                                              @SC90173 05639500
  1281.          LA    0,2                                             @SC90173 05640000
  1282.          KCALL SCRNIO        Release screen                    @SC90173 05640500
  1283.          CLI   0(8),X'88'    Check for WSF query reply         @SC90173 05641000
  1284.          BNE   STMGRG        No, must be something else        @SC90173 05641500
  1285.          CLC   3(2,8),=X'8180' Summary of replies 1st?         @SC90173 05642000
  1286.          BNE   STMGRG        No, must be something else        @SC90173 05642500
  1287.          SR    1,1                                             @SC90173 05643000
  1288.          ICM   1,3,1(8)      Get length of reply               @SC90173 05643500
  1289.          C     1,F64                                           @SC90173 05644000
  1290.          BNL   STMGRN        Too big, give up                  @SC90173 05644500
  1291.          LA    2,0(8,1)      Point to end                      @SC90173 05645000
  1292. STM5AL   CLI   0(2),X'8F'    OEM Aux device?                   @SC90173 05645500
  1293.          BE    RTRN0         Yes, all set                      @SC90173 05646000
  1294.          BCTR  2,0           No, keep looking                  @SC90173 05646500
  1295.          BCT   1,STM5AL                                        @SC90173 05647000
  1296. STMGRN   MVI   TRMTP,C'N'    Probably unsupported device       @SC90173 05647500
  1297.          B     RTRN0         That's all                        @SC90173 05648000
  1298. STMGRG   MVI   TRMTP,C'G'    Assume graphics device            @SC90173 05648500
  1299.          B     RTRN0                                           @SC90173 05649000
  1300. STMSTY   DS    0H            Set up TTY mode                   @SC90264 05649500
  1301.          B     RTRN0                                           @SC86295 05650000
  1302. *                                                                       05650500
  1303. STMS1ST  DC    A(STMS1ORD,L'STMS1ORD)                          @SC88203 05651000
  1304. STMS1ORD DC    X'2B5BBC'     Yale ASCII status request         @SC90264 05651500
  1305. STMS1STI DC    A(STMS1ORI,L'STMS1ORI)                          @SC91150 05652000
  1306. STMS1ORI DC    X'2B5BBE'     Yale ASCII status w/ intrpt       @SC91150 05652500
  1307. STMAEAST DC    A(STMAEAQP,STMAEAL)                             @SC90173 05653000
  1308. STMAEAQP DC    &AEACMD,X'000501FF02' Read Partition Query      @SC90173 05653500
  1309. STMAEAL  EQU   *-STMAEAQP                                      @SC90173 05654000
  1310.          LOCALS ,                                              @SC86295 05654500
  1311. TCTTETT  DS    2X            Terminal type and model codes     @SC90264 05655000
  1312. SETMSG   EXIT                                                           05655500
  1313.          TITLE 'DISKIO Routine - performs disk I/O functions'           05656000
  1314. * ERRNUM unchanged unless there is a disk error.                        05656500
  1315. * Function selected on entry by R0:                                     05657000
  1316. * 0=> unnum read: R1->FAB.  Return R1->buffer,R0=# and remove the       05657500
  1317. *   sequence number (if any) from the buffer (used for TAKE files)      05658000
  1318. * 1=> open (in): R1->pattern FDB, R2->name.  Returns R0->FAB, R1->FDB   05658500
  1319. * 2=> open (out): (same)                                                05659000
  1320. * 3=> test name: R2->name.  Returns R1->FDB if found (else R15=1)       05659500
  1321. * 4=> close file: R1->adr(FAB).                                         05660000
  1322. * 5=> set up search: R1->pattern name.                                  05660500
  1323. * 6=> return next file in list:  Returns R1->FDB + sets up FILNAM       05661000
  1324. * 7=> close search (if any).                                            05661500
  1325. * 8=> test CWD string: R1->string.  Returns R15=0 if ok, else =1.       05662000
  1326. * 9=> read: R1->FAB.  Returns R15=12 if EOF, 0 if ok; R0=# data         05662500
  1327. * 10=> write: R1->FAB.  Returns R15=13 if disk full, 0 if ok.           05663000
  1328. * 11=> test space: R1->pattern FDB (has size in Kbytes),                05663500
  1329. *  R2->name (used if FAB not found), R6->adr(FAB). Return R15=0 if ok.  05664000
  1330. * 12=> analyze R/W error, set ERRNUM, make EMSG: R1->FAB, TMPDW=code    05664500
  1331. *      always returns R15=1                                             05665000
  1332. * 13=> directory info on file: R1->name.  Returns R15=0 if ok.          05665500
  1333. * 14=> delete file: R1->name.  Returns R15=0 if ok.                     05666000
  1334. * 15=> rename file: R1->name, R2->new name.  Returns R15=0 if ok.       05666500
  1335. * 16=> copy file: R1->name, R2->new name.  Returns R15=0 if ok.         05667000
  1336. * 17-> type file: R1-> name. Returns R15=0 if ok.                       05667500
  1337. * 21=> save file status in directory: R1->FAB. (not used)      @SC88168 05668000
  1338. * 22=> open library (in): R2->DDNAME.  Return R15=0 if ok.     @SC89073 05668500
  1339. * 23=> point for next read, R1->adr(FDB), R2=records to skip.  @SC89218 05669000
  1340. *      Return R15=0 if ok.                                     @SC89218 05669500
  1341. DISKIO   ENTER                                                          05670000
  1342.          USING DFHDCTDS,DCTCBAR  Reinstate R8 addressing       @SC90264 05670500
  1343.          USING FABD,3                                          @SC86295 05671000
  1344.          STC   0,DSKCOD      Save for reference                @SC88101 05671500
  1345.          SR    4,4           Signal no block assigned          @SC86295 05672000
  1346.          LA    5,DISKIO+4095                                   @SC90264 05672500
  1347.          USING DISKIO+4095,5 Secondary base register           @SC90264 05673000
  1348.          LR    15,0                                            @SC90264 05673500
  1349.          AR    15,15                                           @SC90264 05674000
  1350.          LH    15,DSK0(15)   Get handler address               @SC90264 05674500
  1351.          B     DSK0(15)      Do the function                   @SC90264 05675000
  1352. DSK0     DC    Y(DSKRED-DSK0,DSKOPNI-DSK0,DSKOPNO-DSK0)   0-2  @SC89073 05675500
  1353.          DC    Y(DSKTEST-DSK0,DSKCLOS-DSK0,DSKNSET-DSK0)  3-5  @SC89073 05676000
  1354.          DC    Y(DSKNXT-DSK0,DSKNSX-DSK0,DSKCWDF-DSK0)    6-8  @SC89073 05676500
  1355.          DC    Y(DSKRED-DSK0,DSKWRT-DSK0,DSKTSP-DSK0)     9-11 @SC89073 05677000
  1356.          DC    Y(DSKXXX-DSK0,DSKDIR-DSK0,DSKDEL-DSK0)    12-14 @SC89073 05677500
  1357.          DC    Y(DSKRNM-DSK0,DSKCPY-DSK0,DSKTYP-DSK0)    15-17 @SC89073 05678000
  1358.          DC    3Y(DSKER1-DSK0)   Spare utilities         18-20 @SC89073 05678500
  1359.          DC    2Y(DSKER1-DSK0),Y(DSKPNT-DSK0)            21-23 @SC89218 05679000
  1360.          DC    8Y(DSKER1-DSK0)                           spare @SC89073 05679500
  1361. *                                                                       05680000
  1362. * Open for input file whose name is at (R2), FDB at (R1)                05680500
  1363. DSKOPNI  BAL   9,DSKALC      Get FAB                           @SC86295 05681000
  1364.          MVC   FABCOMM,=CL8'OPEN I'                            @SC90264 05681500
  1365. DSKOP0   BAL   2,DSKVALID    See if allowed                    @SC90264 05682000
  1366.          BAL   2,DSKLKP      Find file                         @SC90264 05682500
  1367.          BNZ   DSKER1        Not found                         @SC86295 05683000
  1368.          BAL   14,DSKVALS                                      @SC86295 05683500
  1369.          CLI   DSKCOD,1      Just testing?                     @SC90264 05684000
  1370.          BNE   RTRN0         Yes, we're done                   @SC90264 05684500
  1371.          CLI   FDBFL2,X'40'  Extra-partition queue?            @SC90264 05685000
  1372.          BNE   RTRN0         No, don't need to close it first  @SC90264 05685500
  1373. DSKTDCLO BAL   9,DSKTDOPE    Close and open                    @SC90264 05686000
  1374.           B    DSKER1        Oops                              @SC90264 05686500
  1375.          B     RTRN0                                           @SC90264 05687000
  1376. *                                                                       05687500
  1377. DSKTDOPE MVC   DSKEMTS,=CL15'SET Q(    ) CLO'                  @SC90264 05688000
  1378.          MVC   DSKEMTS+6(4),FABFNAM                            @ML90264 05688500
  1379.          EXEC CICS LINK PROGRAM('DFHEMTP') COMMAREA(DSKEMTS),  @SC90264+05689000
  1380.                LENGTH(15) NOHANDLE,                            @SC90264 05689500
  1381.          BAL   14,DSKCHKER   Test success                      @SC90264 05690000
  1382.          BNZR  9             Oops                              @SC90264 05690500
  1383.          MVC   DSKEMTS+12(3),=CL3'OPE'                         @ML90264 05691000
  1384.          EXEC CICS LINK PROGRAM('DFHEMTP') COMMAREA(DSKEMTS),  @SC90264+05691500
  1385.                LENGTH(15) NOHANDLE,                            @SC90264 05692000
  1386.          BAL   14,DSKCHKER   Test success                      @SC90264 05692500
  1387.          BNZR  9             Oops                              @SC90264 05693000
  1388.          B     4(,9)         Return and skip                   @SC90264 05693500
  1389. *                                                                       05694000
  1390. * Open for output file whose name is at (R2), FDB at (R1)               05694500
  1391. DSKOPNO  BAL   9,DSKALC      Get FAB                           @SC86295 05695000
  1392.          MVC   FABCOMM,=CL8'OPEN O'                            @SC90264 05695500
  1393.          BAL   2,DSKVALID    See if allowed                    @SC90264 05696000
  1394.          OI    FABIOF,1      Signal output access              @SC90264 05696500
  1395.          BAL   2,DSKLKP      Find file info                    @SC86295 05697000
  1396.          BNZ   DSKOPLR       Not found, just writing new       @SC87012 05697500
  1397.          TM    FDBFLGS,APPN+SVATT  Should we keep attributes?  @SC90033 05698000
  1398.          BZ    *+8           No                                @SC90033 05698500
  1399.           BAL  14,DSKVALS    Yes, copy old ones to FDB         @SC90033 05699000
  1400.          TM    FDBFLGS,APPN                                    @SC86295 05699500
  1401.          BO    DSKOPLR                                         @SC90033 05700000
  1402.          MVC   DSKSTT+FABUWORD-FABD(4),FABUWORD  Provide word  @SC91150 05700500
  1403.          ERASF FABFID        Delete old                        @SC90264 05701000
  1404.          MVC   FABUWORD,DSKSTT+FABUWORD-FABD     Restore word  @SC91150 05701500
  1405. DSKOPLR  LH    0,FDBLRC                                        @SC88120 05702000
  1406.          CLI   FDBRCF,C'V'   RECFM F limited to LRECL          @SC88120 05702500
  1407.          BNE   DSKSTLR                                         @SC88120 05703000
  1408.          CLI   TYPFIL,C'B'   Binary?                           @SC88120 05703500
  1409.          BE    DSKSTLR4      Yes, always fold                  @SC91150 05704000
  1410.          TM    FABFLGS,FABFPGM+FABFSPL Pipe, spool or QFN?     @SC91150 05704500
  1411.          BNZ   DSKSTLR4      Yes, be strict                    @SC91150 05705000
  1412.          TM    FABFLGS,FABFTD TD queue?                        @SC91150 05705500
  1413.          BZ    *+12          No, ok to use max                 @SC91150 05706000
  1414.           TM   FDBFL2,TDEXTRBM  Extra?                         @SC91150 05706500
  1415.           BO   DSKSTLR4      Yes, must observe LRECL           @SC91150 05707000
  1416.          L     0,MAXLRC      TEXT file, no limit               @SC87012 05707500
  1417. DSKSTLR4 S     0,F4          Allow for RDW                     @SC91150 05708000
  1418. DSKSTLR  ST    0,FABLRTR     Set effective record length       @SC88120 05708500
  1419.          TM    FABFLGS,FABFTAK                                 @SC90264 05709000
  1420.          BZ    RTRN0                                           @SC90264 05709500
  1421.          KCALL KFILIO,(3),E=DSKER1                             @SC90264 05710000
  1422.          B     RTRN0                                           @SC86295 05710500
  1423. *                                                                       05711000
  1424. * Test for existence of file whose name is at (R2)                      05711500
  1425. DSKTEST  XC    DSKFDB,DSKFDB                                   @SC90264 05712000
  1426.          MVC   DSKSTNM,0(2)                                    @SC90264 05712500
  1427.          LA    3,DSKSTT                                        @SC86295 05713000
  1428.          MVC   FABCOMM,=CL8'TEST'                              @SC90264 05713500
  1429.          B     DSKOP0                                          @SC86295 05714000
  1430. *                                                                       05714500
  1431. * Test validity using external routine                         @SC90264 05715000
  1432. DSKVALID ICM   15,15,=A(KVALID)                                @SC90264 05715500
  1433.          BZR   2                                               @SC90264 05716000
  1434.          MVC   FABRESP-FABD+DSKSTT(6),=X'123456' Odd err code  @SC90264 05716500
  1435.          KCALL (15),(3),EXT,E=DSKER1 Quit if it says so        @SC90264 05717000
  1436.          BR    2                                               @SC90264 05717500
  1437. *                                                                       05718000
  1438. * Close file whose ticket is at (R1), release block                     05718500
  1439. DSKCLOS  ICM   3,15,0(1)     Get FAB ptr, if any               @SC86295 05719000
  1440.          BZ    RTRN0         None, ignore                      @SC86295 05719500
  1441.          XC    0(4,1),0(1)   Yes, now clear ticket             @SC86295 05720000
  1442.          MVC   FABCOMM,=CL8'CLOSE'                             @SC90264 05720500
  1443.          TM    FABFLGS,FABFPGM+FABFSPL Pipe?                   @SC90264 05721000
  1444.          BZ    *+8                                             @SC90264 05721500
  1445.           BAL  2,DSKLKPG     Yes, handle closing               @SC90264 05722000
  1446.          TM    FABFLGS,FABFTAK Internal file?                  @SC90264 05722500
  1447.          BZ    DSKCLOS2                                        @SC90264 05723000
  1448.          KCALL KFILIO,(3)    Yes, handle closing               @SC90264 05723500
  1449. DSKCLOS2 DS    0H                                              @SC90264 05724000
  1450. *                            Close file                        @SC90264 05724500
  1451.          LR    1,3                                             @SC86295 05725000
  1452.          LA    0,FABDWDS                                       @SC86295 05725500
  1453.          DMSFRET DWORDS=(0),LOC=(1)                            @SC86295 05726000
  1454.          B     RTRN0                                           @SC86295 05726500
  1455. *                                                                       05727000
  1456. * Point past 1st N records of file at (R1)                     @SC89218 05727500
  1457. DSKPNT   ICM   3,15,0(1)     Get ticket                        @SC89218 05728000
  1458.          BZ    RTRN1         Not open                          @SC89218 05728500
  1459.          LR    3,1                                             @SC89218 05729000
  1460.          LTR   2,2           Number of records to skip         @SC89218 05729500
  1461.          BNP   RTRN0         Never mind                        @SC89218 05730000
  1462.          TM    FABFLGS,FABFTS+FABFTAK  Temp stor or TAKE?      @SC90264 05730500
  1463.          BZ    DSKPNTL       No, must read to skip             @SC90264 05731000
  1464.          STH   2,FABRN       Yes, just set pointer             @SC90264 05731500
  1465.          B     RTRN0                                           @SC90264 05732000
  1466. DSKPNTL  READF 0(,3),E=RTRN1 Skip one                          @SC89218 05732500
  1467.          BCT   2,DSKPNTL     ... until finished                @SC89218 05733000
  1468.          B     RTRN          Return with completion code       @SC89218 05733500
  1469. *                                                                       05734000
  1470. * Read from file whose ticket is at (R1)                                05734500
  1471. DSKRED   LTR   3,1           Get FAB ptr                       @SC86299 05735000
  1472.          BNP   RTRN1         Not defined anymore               @SC86299 05735500
  1473.          LA    1,1                                             @SC90264 05736000
  1474.          AH    1,FABRN       Bump record counter               @SC90264 05736500
  1475.          STH   1,FABRN                                         @SC90264 05737000
  1476.          MVC   FABNORD,FDBLRC Set up length of reads           @SC90264 05737500
  1477.          L     6,FDBBUFF     Use real buffer                   @SC90264 05738000
  1478.          MVC   FABCOMM,=CL8'READ' Op code for error message    @SC90264 05738500
  1479.          TM    FABFLGS,FABFTS Temp stor?                       @SC90264 05739000
  1480.          BO    DSKREDS       Yes, do it                        @SC90264 05739500
  1481.          TM    FABFLGS,FABFTD TD queue?                        @SC90264 05740000
  1482.          BO    DSKREDD       Yes, do it                        @SC90264 05740500
  1483.          TM    FABFLGS,FABFTAK Internal file?                  @SC90264 05741000
  1484.          BO    DSKREDT       Yes, do it                        @SC90264 05741500
  1485.          TM    FABFLGS,FABFPGM+FABFSPL Pipe?                   @SC90264 05742000
  1486.          BZ    DSKRER        ???                               @SC90264 05742500
  1487.          BAL   2,DSKLKPG     Yes, handle it                    @SC90264 05743000
  1488.          B     DSKRED2                                         @SC90264 05743500
  1489. DSKREDS  DS    0H                                              @SC90264 05744000
  1490.          MVC   FABCOMM,=CL8'READ TS' Op code for error message @SC90264 05744500
  1491.          EXEC CICS READQ TS QUEUE(FABFNAM) ITEM(FABRN),        @SC90264+05745000
  1492.                INTO(0(,6)) LENGTH(FABNORD) NOHANDLE,           @SC90264 05745500
  1493.          LA    0,X'01'       ITEMERR for TS queue              @SC90264 05746000
  1494.          B     DSKRED1                                         @SC90264 05746500
  1495. DSKREDT  KCALL KFILIO,(3)                                      @SC90264 05747000
  1496.          LTR   15,15                                           @SC90264 05747500
  1497.          LA    0,X'81'       NOTFND for VSAM                   @SC90264 05748000
  1498.          B     DSKRED2                                         @SC90264 05748500
  1499. DSKREDD  MVC   FABCOMM,=CL8'READ TD' Op code for error message @SC90264 05749000
  1500.          EXEC CICS READQ TD QUEUE(FABFNAM) INTO(0(,6)),        @SC90264+05749500
  1501.                LENGTH(FABNORD) NOHANDLE,                       @SC90264 05750000
  1502.          LA    0,X'01'       QZERO for TD queue                @SC90264 05750500
  1503. DSKRED1  BAL   14,DSKCHKER   Test success                      @SC90264 05751000
  1504. DSKRED2  BNZ   DSKRERX       No, see if EOF                    @SC90264 05751500
  1505.          LH    7,FABNORD     Actual length                     @SC90264 05752000
  1506.          L     1,FDBBUFF     Ptr to data area                  @SC90264 05752500
  1507.          LM    14,15,FDBBUFF Get buffer and size               @SC90264 05753000
  1508.          LR    0,7           Save length for number check      @SC88101 05753500
  1509.          AR    7,1           End of record                     @SC86299 05754000
  1510.          CLI   DSKCOD,0      NONUM?                            @SC88101 05754500
  1511.          BNE   DSKREDC       No, use everything                @SC88101 05755000
  1512.          CLI   FDBRCF,C'F'   Fixed-length records?             @SC88101 05755500
  1513.          BNE   DSKREDV       No, line numbers at start (if any)@SC88101 05756000
  1514.          CH    0,=H'80'      See if F/80                       @SC88101 05756500
  1515.          BNE   DSKREDC       No                                @SC88101 05757000
  1516.          MVZ   NUMPAT(5),75(1)  See if 76-80 are all numeric   @SC88101 05757500
  1517.          CLC   NUMPAT(5),=8C'0'                                @SC88101 05758000
  1518.          BNE   DSKREDC       No                                @SC88101 05758500
  1519.          S     7,F8          Yes, move the end back            @SC88101 05759000
  1520.          B     DSKREDC                                         @SC88101 05759500
  1521. DSKREDV  LA    0,8(1)        Is length at least 8?             @SC88101 05760000
  1522.          CR    0,7                                             @SC88101 05760500
  1523.          BNL   DSKREDC       No, can't be numbered             @SC88101 05761000
  1524.          MVZ   NUMPAT(8),0(1)   See if 1-8 all numeric         @SC88101 05761500
  1525.          CLC   NUMPAT(8),=8C'0'                                @SC88101 05762000
  1526.          BNE   DSKREDC       No, not numbered                  @SC88101 05762500
  1527.          LA    1,8(1)        Yes, skip over number             @SC88101 05763000
  1528. DSKREDC  DS    0H                                              @SC88101 05763500
  1529.          SR    7,1           Revised length                    @SC86299 05764000
  1530.          LR    6,1                                             @SC86299 05764500
  1531.          CR    7,15                                            @SC90264 05765000
  1532.          BNL   *+6                                             @SC86299 05765500
  1533.          LR    15,7          Buffer not filled                 @SC90264 05766000
  1534.          L     1,4(13)                                         @SC86299 05766500
  1535.          ST    15,20(1)      Return length in R0               @SC90264 05767000
  1536.          CLI   DSKCOD,0      NONUM?                            @SC88101 05767500
  1537.          BNE   *+8                                             @SC88101 05768000
  1538.           ST   14,24(,1)     Yes, return R1 ptr                @SC90264 05768500
  1539.          CR    14,6          Already in place?                 @SC90264 05769000
  1540.          BE    *+6           Yes, don't copy                   @SC90264 05769500
  1541.           MVCL 14,6          Copy to buffer                    @SC90264 05770000
  1542.          B     RTRN0                                           @SC86299 05770500
  1543. * Test for successful completion of CICS command               @SC90264 05771000
  1544. DSKCHKER L     15,DFHEIBP    Set up to copy EIB code           @SC90264 05771500
  1545.          USING DFHEIBLK,15                                     @SC90264 05772000
  1546.          MVC   FABRESP,EIBRCODE                                @SC90264 05772500
  1547.          CLC   F0,FABRESP    Ok?                               @SC90264 05773000
  1548.          BR    14            Return with CC                    @SC90264 05773500
  1549.          DROP  15                                              @SC90264 05774000
  1550. * Error on input                                               @SC90264 05774500
  1551. DSKRER   LA    15,1          Return code for ordinary error    @SC90264 05775000
  1552. DSKRER2  MVI   ERRNUM,ERRDIE Disk I/O error                    @SC90264 05775500
  1553.          B     RTRN          Indicate error                    @SC90264 05776000
  1554. DSKFUL   LA    15,13         Indicate disk full                @SC90264 05776500
  1555.          B     DSKRER2                                         @SC90264 05777000
  1556. * Error on read.  See if just EOF                              @SC90264 05777500
  1557. DSKRERX  CLM   0,1,FABRESP   R0 has code that means EOF        @SC90264 05778000
  1558.          BNE   DSKRER        No, just ordinary error           @SC90264 05778500
  1559. * End of file on input. Don't close it yet.                    @SC86295 05779000
  1560. DSKEOD   LA    15,12         End return code                   @SC86295 05779500
  1561.          B     RTRN                                            @SC86295 05780000
  1562. *                                                                       05780500
  1563. * Write to file whose ticket is at (R1)                                 05781000
  1564. DSKWRT   LTR   3,1           Get FAB ptr                       @SC86299 05781500
  1565.          BNP   RTRN1         Not defined anymore               @SC86299 05782000
  1566.          LA    1,1                                             @SC90264 05782500
  1567.          AH    1,FABRN       Bump record counter               @SC90264 05783000
  1568.          STH   1,FABRN                                         @SC90264 05783500
  1569.          LM    6,7,FDBBUFF   Get buffer and size               @SC90264 05784000
  1570.          STH   7,FABNORD     Put length in temp var            @SC90264 05784500
  1571.          MVC   FABCOMM,=CL8'WRITE' Op code for error message   @SC90264 05785000
  1572.          TM    FABFLGS,FABFTS  Temp stor?                      @SC90264 05785500
  1573.          BO    DSKWRTS       Yes, do it                        @SC90264 05786000
  1574.          TM    FABFLGS,FABFTD TD queue?                        @SC90264 05786500
  1575.          BO    DSKWRTD       Yes, do it                        @SC90264 05787000
  1576.          TM    FABFLGS,FABFTAK Internal file?                  @SC90264 05787500
  1577.          BO    DSKWRTT       Yes, do it                        @SC90264 05788000
  1578.          TM    FABFLGS,FABFPGM+FABFSPL Pipe?                   @SC90264 05788500
  1579.          BZ    DSKRER        Huh?                              @SC90264 05789000
  1580.          BAL   2,DSKLKPG     Yes, handle it                    @SC90264 05789500
  1581.          LA    0,X'10'       NOSPACE code for Extra TD queues  @SC90264 05790000
  1582.          B     DSKWRT2                                         @SC90264 05790500
  1583. DSKWRTS  DS    0H                                              @SC90264 05791000
  1584.          MVC   FABCOMM,=CL8'WRIT TS' Op code for error message @SC90264 05791500
  1585.          TM    FABFLGS,FABFMAIN  Main storage?                 @SC90264 05792000
  1586.          BZ    DSKWRTSA      No, use AUX                       @SC90264 05792500
  1587.          EXEC CICS WRITEQ TS QUEUE(FABFNAM) FROM(0(,6)) MAIN,  @SC90264+05793000
  1588.                LENGTH(FABNORD) NOHANDLE,                       @SC90264 05793500
  1589.          LA    0,X'08'       NOSPACE code for TS queues        @SC90264 05794000
  1590.          B     DSKWRT1       Test success                      @SC90264 05794500
  1591. DSKWRTSA EXEC CICS WRITEQ TS QUEUE(FABFNAM) FROM(0(,6)),       @SC90264+05795000
  1592.                AUXILIARY LENGTH(FABNORD) NOHANDLE,             @SC90264 05795500
  1593.          LA    0,X'08'       NOSPACE code for TS queues        @SC90264 05796000
  1594.          B     DSKWRT1       Test success                      @SC90264 05796500
  1595. DSKWRTT  KCALL KFILIO,(3)                                      @SC90264 05797000
  1596.          LTR   15,15                                           @SC90264 05797500
  1597.          LA    0,X'83'       NOSPACE code for VSAM WRITE       @SC90264 05798000
  1598.          B     DSKWRT2                                         @SC90264 05798500
  1599. DSKWRTD  MVC   FABCOMM,=CL8'WRIT TD' Op code for error message @SC90264 05799000
  1600.          EXEC CICS WRITEQ TD QUEUE(FABFNAM) FROM(0(,6)),       @SC90264+05799500
  1601.                LENGTH(FABNORD) NOHANDLE,                       @SC90264 05800000
  1602.          LA    0,X'10'       NOSPACE code for TD queues        @SC90264 05800500
  1603. DSKWRT1  BAL   14,DSKCHKER   Test success                      @SC90264 05801000
  1604. DSKWRT2  BZ    RTRN0                                           @SC90264 05801500
  1605.          CLM   0,1,FABRESP   NOSPACE?                          @SC90264 05802000
  1606.          BE    DSKFUL        Yes, treat it separately          @SC90264 05802500
  1607.          B     DSKRER        No, catch-all I/O error           @SC90264 05803000
  1608. *                                                                       05803500
  1609. * Analyze error: code in FABRESP                               @SC90264 05804000
  1610. DSKXXX   LR    3,1                                             @SC89073 05804500
  1611.          MVI   ERRNUM,ERRDIE Set Kermit error code             @SC87338 05805000
  1612.          L     2,EMSGP       Ptr to msg buffer                 @SC87338 05805500
  1613.          MVC   0(8,2),FABCOMM Copy oprn name                   @SC87338 05806000
  1614.          MVC   8(2,2),=C'R='                                   @SC87338 05806500
  1615.          UNPK  10(13,2),FABRESP(7) Copy error code             @SC90264 05807000
  1616.          TR    10(12,2),TRHEX Convert to hex                   @SC90264 05807500
  1617.          MVC   EMSGL,=F'22'  Length of string                  @SC90264 05808000
  1618.          B     RTRN1                                           @SC87338 05808500
  1619. *                                                                       05809000
  1620. * Directory Info on file R1->name, return R15=0 if OK                   05809500
  1621. DSKDIR   DS    0H                                              @SC89073 05810000
  1622.          NI    DSKFL,255-NFFND                                 @SC90264 05810500
  1623.          NXTFSET E=DSKDRERR  Set up search (name at R1)        @SC88308 05811000
  1624. DSKDRLP  NXTF  E=DSKDRZ      Find next entry                   @SC88308 05811500
  1625.          LR    3,1           Move FDB ptr                      @SC90264 05812000
  1626.          SH    3,=Y(FDBD-FABD)  Set up addressability          @SC90264 05812500
  1627.          TM    DSKFL,NFFND   Found something already?          @SC90264 05813000
  1628.          BO    DSKDRL1                                         @SC90264 05813500
  1629.          WTEXT 'Name               RFM   LRECL   #recs  Kbytes  Type   +05814000
  1630.                  Date/time'                                    @SC91150 05814500
  1631.          OI    DSKFL,NFFND   Found something, at least one     @SC88308 05815000
  1632. DSKDRL1  DS    0H                                              @SC90264 05815500
  1633.          LA    7,CMD         Make attr list in buffer          @SC90264 05816000
  1634.          LA    0,FFDSP       Format the file name              @SC90264 05816500
  1635.          KCALL FSPEC,FABFID                                    @SC90264 05817000
  1636.          LA    2,20(,7)      Allow enough room                 @SC90264 05817500
  1637. DSKDRBL  MVI   0(15),C' '                                      @SC90264 05818000
  1638.          LA    15,1(,15)                                       @SC90264 05818500
  1639.          CR    15,2                                            @SC90264 05819000
  1640.          BNH   DSKDRBL                                         @SC90264 05819500
  1641.          MVC   1(1,2),FDBRCF RECFM, if any                              05820000
  1642.          CLI   1(2),0                                                   05820500
  1643.          BNE   *+8                                                      05821000
  1644.           MVI  1(2),C'?'                                                05821500
  1645.          LA    2,2(,2)                                                  05822000
  1646.          LH    0,FDBLRC                                                 05822500
  1647.          BAL   9,DSKNUM      Add the logical record length              05823000
  1648.          LH    0,FDBNREC                                       @SC90264 05823500
  1649.          BAL   9,DSKNUM      Add the record count              @SC90264 05824000
  1650.          L     0,FDBSIZE                                       @SC90264 05824500
  1651.          BAL   9,DSKNUM      Add the file size                 @SC90264 05825000
  1652.          MVC   0(2,2),=CL2' ' Leave some blanks                         05825500
  1653.          LA    2,2(,2)       Bump the length                   @SC88308 05826000
  1654.          ICM   0,8,FDBFL2                                               05826500
  1655.          LA    15,4                                            @SC90264 05827000
  1656.          LA    6,DSKTYPS                                                05827500
  1657. DSKDRTL  LTR   0,0                                                      05828000
  1658.          BM    DSKDRTP                                                  05828500
  1659.          LA    6,6(,6)                                                  05829000
  1660.          SLL   0,1                                                      05829500
  1661.          BCT   15,DSKDRTL                                      @SC90264 05830000
  1662. DSKDRTP  MVC   0(6,2),0(6)                                              05830500
  1663.          LA    2,6(,2)                                                  05831000
  1664.          CLI   FDBDATE,X'19' Validate century                  @SC91150 05831500
  1665.          BL    DSKDRDZ       No good!                          @SC91150 05832000
  1666.          CLI   FDBDATE,X'20'                                   @SC91150 05832500
  1667.          BH    DSKDRDZ                                         @SC91150 05833000
  1668.          MVC   0(DSKDRPTL,2),DSKDRPT                           @SC91150 05833500
  1669.          ED    0(DSKDRPTL,2),FDBDATE                           @SC91150 05834000
  1670.          LA    2,DSKDRPTL(,2)                                  @SC91150 05834500
  1671. DSKDRDZ  DS    0H                                              @SC91150 05835000
  1672. *                                                                       05835500
  1673.          SR    2,7           Get the output length             @SC90264 05836000
  1674.          WTEXT (7),(2)                                         @SC90264 05836500
  1675.          B     DSKDRLP                                         @SC88308 05837000
  1676. DSKDRPT  DC    C'  ',4X'20',C'/',2X'20',C'/',2X'20',C' ' Date  @SC91150 05837500
  1677.          DC    2X'20',C':',2X'20',C':',2X'20'            Time  @SC91150 05838000
  1678. DSKDRPTL EQU   *-DSKDRPT     Length of pattern                 @SC91150 05838500
  1679. *                                                              @SC88308 05839000
  1680. DSKDRZ   TM    DSKFL,NFFND   Any files found?                  @SC90264 05839500
  1681.          BO    RTRN0         Yes, return gracefully            @SC88308 05840000
  1682. DSKDRERR B     RTRN1         Not found or invalid              @SC90264 05840500
  1683. *                                                                       05841000
  1684. DSKNUM   CVD   0,TMPDW       Pack the binary value                      05841500
  1685.          OI    TMPDW+7,15    Set zone                                   05842000
  1686.          UNPK  0(8,2),TMPDW  Convert to printable                       05842500
  1687.          LA    15,7(,2)      Point to end of string            @SC90264 05843000
  1688. DSKNUM2  CLI   0(2),C'0'     Remove leading zeros                       05843500
  1689.          BNE   DSKNUM3       except for the first one.                  05844000
  1690.          MVI   0(2),C' '                                                05844500
  1691.          LA    2,1(2)                                                   05845000
  1692.          CR    2,15                                            @SC90264 05845500
  1693.          BL    DSKNUM2                                                  05846000
  1694. DSKNUM3  LA    2,1(,15)      Get the new ending address        @SC90264 05846500
  1695.          BR    9                                                        05847000
  1696. *                                                                       05847500
  1697. DSKTYPS  DC    C'INTRA '                                                05848000
  1698.          DC    C'EXTRA '                                                05848500
  1699.          DC    C'INDIR.'                                                05849000
  1700.          DC    C'REMOTE'                                                05849500
  1701.          DC    C'OTHER '                                                05850000
  1702. *                                                                       05850500
  1703. * Delete file.  R1-> name. Returns R15=0 if ok.                         05851000
  1704. DSKDEL   DS    0H                                              @SC89073 05851500
  1705.          LR    6,1                                             @SC90264 05852000
  1706.          LA    3,DSKSTT                                        @SC86295 05852500
  1707.          MVC   FABFID,0(6)   Copy name into temp FAB           @SC90264 05853000
  1708.          MVC   FABCOMM,=CL8'DELETE'                            @SC90264 05853500
  1709.          BAL   2,DSKVALID    See if allowed                    @SC90264 05854000
  1710.          TM    FABFLGS,FABFPGM+FABFSPL Pipe?                   @SC90264 05854500
  1711.          BNZ   DSKDELP       Yes, do it                        @SC90264 05855000
  1712.          TM    FABFLGS,FABFTAK Internal file?                  @SC90264 05855500
  1713.          BO    DSKDELT       Yes, do it                        @SC90264 05856000
  1714.          TM    FABFLGS,FABFTS   Temp stor?                     @SC90264 05856500
  1715.          BZ    DSKDELD       No, Transdat                      @SC90264 05857000
  1716.          EXEC CICS DELETEQ TS QUEUE(FABFNAM) NOHANDLE,         @SC90264 05857500
  1717.          BAL   14,DSKCHKER   Test success                      @SC90264 05858000
  1718.          BNZ   RTRN1         Oops                              @SC90264 05858500
  1719.          B     RTRN0                                           @SC90264 05859000
  1720. DSKDELP  BAL   2,DSKLKPG     Handle it                         @SC90264 05859500
  1721.          BNZ   RTRN1         Something was wrong               @SC90264 05860000
  1722.          B     RTRN0                                           @SC90264 05860500
  1723. DSKDELT  KCALL KFILIO,(3),E=RTRN1                              @SC90264 05861000
  1724.          B     RTRN0                                           @SC90264 05861500
  1725. DSKDELD  DS    0H                                              @SC90264 05862000
  1726.          BAL   2,DSKLKP      See if it's there                 @SC90264 05862500
  1727.          BNZ   RTRN1         No, say error                     @SC90264 05863000
  1728.          TM    TDDCTDT,TDINDTBM Intra-partition?               @SC90264 05863500
  1729.          BZ    DSKTDCLO      No, shouldn't try to purge it     @SC90264 05864000
  1730.          EXEC CICS DELETEQ TD QUEUE(FABFNAM) NOHANDLE,         @SC90264 05864500
  1731.          BAL   14,DSKCHKER   Test success                      @SC90264 05865000
  1732.          BNZ   RTRN1         Oops                              @SC90264 05865500
  1733.          B     RTRN0                                           @SC90264 05866000
  1734. *                                                                       05866500
  1735. * Rename file.  R1-> name. R2-> new name. Returns R15=0 if ok.          05867000
  1736. DSKRNM   DS    0H                                              @SC89073 05867500
  1737.          B     RTRN1                                                    05868000
  1738. *                                                                       05868500
  1739. * Copy file.  R1-> name. R2-> new name. Returns R15=0 if ok.            05869000
  1740. DSKCPY   DS    0H                                              @SC89073 05869500
  1741.          LR    6,1           Point to source file name         @SC90264 05870000
  1742.          LR    7,2           Point to new name                 @SC90264 05870500
  1743.          NI    FILFLGS,255-APPN Don't append                   @SC90264 05871000
  1744.          OI    FILFLGS,SVATT Use old attributes on output      @SC90264 05871500
  1745.          L     9,EMSGP       Ptr to msg buffer                 @SC90264 05872000
  1746.          MVC   0(14,9),=C'File not found'  In case OPEN dies   @SC90264 05872500
  1747.          MVC   EMSGL,=F'14'  Length of string                  @SC90264 05873000
  1748.          OPENF I,(6),FILFDB,FILPTR,E=DSKCPXX                   @SC90264 05873500
  1749.          MVC   0(14,9),=C'File too short'  In case POINTF dies @SC91150 05874000
  1750.          MVC   EMSGL,=F'14'  Length of string                  @SC91150 05874500
  1751.          POINTF FILPTR,IFOPTS-IFILE(6),E=DSKCPXX Skip if any   @SC91150 05875000
  1752.          MVC   0(19,9),=C'Illegal output file'                 @SC90264 05875500
  1753.          MVC   EMSGL,=F'19'  Length of string                  @SC90264 05876000
  1754.          LR    3,0           Pass input FDB to output          @SC90264 05876500
  1755.          OPENF O,(7),FDBD,DSKCPPTR,E=DSKCPXX                   @SC90264 05877000
  1756.          LR    3,0           Point to output FAB               @SC90264 05877500
  1757. DSKCPLP  ICM   1,15,IFOPTS-IFILE(6)   Get record counter       @SC91150 05878000
  1758.          AL    1,F1                                            @SC91150 05878500
  1759.          STCM  1,15,IFOPTS-IFILE(6)   Update record counter    @SC91150 05879000
  1760.          CLM   1,15,IFOPTS+4-IFILE(6) Passed end?              @SC91150 05879500
  1761.          BH    DSKTYEOF      Yes, quit now                     @SC91150 05880000
  1762.          L     7,WBUF        Point to data buffer              @SC91150 05880500
  1763.          READF FILPTR,BUFFER=(7),E=DSKTYP50                    @SC91150 05881000
  1764.          CLI   FDBRCF,C'F'   Fixed?                            @SC90264 05881500
  1765.          BNE   DSKCPWR       No, just write what we got        @SC90264 05882000
  1766.          CH    0,FDBLRC      Yes, see if correct length        @SC90264 05882500
  1767.          BE    DSKCPWR       Ok, do it                         @SC90264 05883000
  1768.          LR    8,0           No, save actual length            @SC90264 05883500
  1769.          LH    0,FDBLRC      Get correct length                @SC90264 05884000
  1770.          BH    DSKCPWR       Was too much, just truncate       @SC90264 05884500
  1771.          LR    9,0                                             @SC90264 05885000
  1772.          SR    9,8           Was too little, get length to pad @SC90264 05885500
  1773.          AR    8,7                                             @SC91150 05886000
  1774.          SR    15,15                                           @SC90264 05886500
  1775.          ICM   15,8,BLANK                                      @SC90264 05887000
  1776.          MVCL  8,14                                            @SC90264 05887500
  1777. DSKCPWR  WRITF DSKCPPTR,BUFFER=(7),BSIZE=(0),E=DSKCPER         @SC91150 05888000
  1778.          B     DSKCPLP                                         @SC90264 05888500
  1779. *                                                                       05889000
  1780. * Type file.   R1-> name. Returns R15=0 if ok.                          05889500
  1781. *  N.B. DSKCPPTR must be zero here to share code with DSKCPY   @SC90264 05890000
  1782. DSKTYP   DS    0H                                              @SC89073 05890500
  1783.          LR    6,1           Point to file name                @SC90264 05891000
  1784.          L     9,EMSGP       Ptr to msg buffer                 @SC90264 05891500
  1785.          MVC   0(14,9),=C'File not found'  In case OPEN dies   @SC90264 05892000
  1786.          MVC   EMSGL,=F'14'  Length of string                  @SC90264 05892500
  1787.          OPENF I,(6),FILFDB,FILPTR,E=DSKCPXX                   @SC90264 05893000
  1788.          LR    3,0           Point to FAB                      @PG88335 05893500
  1789.          MVC   0(14,9),=C'File too short'  In case POINTF dies @SC91150 05894000
  1790.          MVC   EMSGL,=F'14'  Length of string                  @SC91150 05894500
  1791.          POINTF FILPTR,IFOPTS-IFILE(6),E=DSKCPXX Skip if any   @SC91150 05895000
  1792.          LH    1,FDBLRC                                        @PG88335 05895500
  1793.          CH    1,=H'130'     Check record length !!!           @PG88335 05896000
  1794.          BL    DSKTYP20                                        @PG88335 05896500
  1795.          WTEXT 'Only first 130 characters displayed!'          @PG88335 05897000
  1796. DSKTYP20 ICM   1,15,IFOPTS-IFILE(6)   Get record counter       @SC91150 05897500
  1797.          AL    1,F1                                            @SC91150 05898000
  1798.          STCM  1,15,IFOPTS-IFILE(6)   Update record counter    @SC91150 05898500
  1799.          CLM   1,15,IFOPTS+4-IFILE(6) Passed end?              @SC91150 05899000
  1800.          BH    DSKTYEOF      Yes, quit now                     @SC91150 05899500
  1801.          L     3,RBUF        Point to data buffer              @SC91150 05900000
  1802.          READF FILPTR,BUFFER=(3),E=DSKTYP50                    @PG88335 05900500
  1803.          CH    0,=H'130'     Record too long ?                 @PG88335 05901000
  1804.          BL    DSKTYP30                                        @PG88335 05901500
  1805.          LA    0,129         Yes, truncate...                  @PG88335 05902000
  1806. DSKTYP30 LTR   0,0           Is it null ?                      @PG88335 05902500
  1807.          BNZ   DSKTYP35                                        @PG88335 05903000
  1808.          MVI   0(3),X'40'    Then we must have at least        @PG88335 05903500
  1809.          LA    0,1           one character to output           @PG88335 05904000
  1810. DSKTYP35 WTEXT (3)                                             @PG88335 05904500
  1811.          B     DSKTYP20                                        @PG88335 05905000
  1812. DSKTYEOF L     15,F12        EOF code - hit end                @SC91150 05905500
  1813. DSKTYP50 C     15,F12        EOF code ?                        @PG88335 05906000
  1814.          LA    7,0           If so, no error                   @SC90264 05906500
  1815.          BE    DSKTYP70                                        @PG88335 05907000
  1816. DSKCPER  ERRF  ,             Analyze error code                @SC90264 05907500
  1817. DSKCPXX  LA    7,1           Set return code                   @SC90264 05908000
  1818.          ICM   0,15,EMSGL    Length of message                 @SC90264 05908500
  1819.          BNP   DSKTYP70                                        @SC90264 05909000
  1820.          L     1,EMSGP                                         @SC90264 05909500
  1821.          WTEXT (1),(0)       Show error message                @SC90264 05910000
  1822. DSKTYP70 CLOSF FILPTR                                          @PG88335 05910500
  1823.          CLOSF DSKCPPTR                                        @SC90264 05911000
  1824.          LR    15,7          Copy return code                  @SC90264 05911500
  1825.          B     RTRN                                            @SC90264 05912000
  1826. *                                                                       05912500
  1827. * Return on error, release useless block, if any                        05913000
  1828. DSKER1   LTR   1,4           Any block assigned?               @SC86295 05913500
  1829.          BZ    RTRN1         No                                @SC86295 05914000
  1830.          LA    0,FABDWDS     Yes, release it                   @SC86295 05914500
  1831.          DMSFRET DWORDS=(0),LOC=(1)                            @SC86295 05915000
  1832.          B     RTRN1         Flag error                        @SC86295 05915500
  1833. *                                                                       05916000
  1834. * Allocate new FAB and initialize with name at (R2) and with   @SC90264 05916500
  1835. *  FDB pattern at (R6); put name in DSKSTT; return FAB,FDB     @SC90264 05917000
  1836. *  ptrs to DISKIO caller as R0,R1; leave R3->FAB, R4->FAB,     @SC90264 05917500
  1837. *  R6->pattern; return via R9.                                 @SC90264 05918000
  1838. DSKALC   LR    6,1           Save FDB ptr                      @SC90264 05918500
  1839.          MVC   DSKSTNM,0(2)                                    @SC86295 05919000
  1840.          LA    0,FABDWDS     Yes, release it                   @SC86295 05919500
  1841.          DMSFREE DWORDS=(0),ERR=DSKER1                         @SC86295 05920000
  1842.          LR    3,1           New block ptr                     @SC86295 05920500
  1843.          LA    4,FDBD        FDB pointer                       @SC88120 05921000
  1844.          RETREG (0,3),(1,4)  Return (3) as R0, (4) as R1       @SC89218 05921500
  1845.          LR    4,3           Indicate we have it               @SC88120 05922000
  1846.          XC    0(8*FABDWDS,3),0(3)                             @SC86295 05922500
  1847.          MVC   FDBD(FDBCOP),0(6) Copy user's FDB               @SC90264 05923000
  1848.          MVC   FABFID,0(2)                                     @SC90264 05923500
  1849.          BR    9                                               @SC86295 05924000
  1850. *                                                                       05924500
  1851. * Look up file whose name is in FAB; return CC=Z if found.     @SC90264 05925000
  1852. * Return via R2.  Uses R0,R1,R8,R9,R14,R15.                    @SC90264 05925500
  1853. * Leaves DSKSECPL -> TDDCT or TSUTE or KFSBLK                  @SC90264 05926000
  1854. DSKLKP   DS    0H                                              @SC90264 05926500
  1855.          TM    FABFLGS,FABFTD TD queue?                        @SC90264 05927000
  1856.          BO    DSKLKPD       Yes, do it                        @SC90264 05927500
  1857.          TM    FABFLGS,FABFPGM+FABFSPL Pipe?                   @SC90264 05928000
  1858.          BNZ   DSKLKPG       Yes, do it                        @SC90264 05928500
  1859.          TM    FABFLGS,FABFTAK Internal file?                  @SC90264 05929000
  1860.          BO    DSKLKTK       Yes, do it                        @SC90264 05929500
  1861.          TM    FABFLGS,FABFTS TS queue?                        @SC90264 05930000
  1862.          BZ    DSKLKNF       No, something is wrong            @SC90264 05930500
  1863.          MVI   FDBRCF,C'V'   Enforce RECFM=V                   @SC91150 05931000
  1864.          L     1,CSAPTR                                        @NL90264 05931500
  1865.          L     9,CSATSMTA-DFHCSABA(1)  A(temp storage table)   @NL90264 05932000
  1866.          USING DFHTSUT,9                                       @SC90264 05932500
  1867.          USING DFHTSUTE,1                                      @SC90264 05933000
  1868. DSKLKPSL LTR   9,9                                             @SC90264 05933500
  1869.          BZ    DSKLKNF       Not found                         @SC90264 05934000
  1870.          CLC   TSUTCC,F0     Test for no entries               @SC90264 05934500
  1871.          BE    DSKLKPSN                                        @SC90264 05935000
  1872.          L     1,TSUTAHI     First on chain                    @SC90264 05935500
  1873. DSKLKPS1 CLC   TSUTEID,FABFNAM Match?                          @SC90264 05936000
  1874.          BE    DSKLKSG       Found it                          @SC90264 05936500
  1875.          C     1,TSUTALI     Any more on chain?                @SC90264 05937000
  1876.          BNL   DSKLKPSN                                        @SC90264 05937500
  1877.          LA    1,TSUTELN(,1) Check next entry                  @SC90264 05938000
  1878.          B     DSKLKPS1                                        @SC90264 05938500
  1879. DSKLKPSN L     9,TSUTFC                                        @SC90264 05939000
  1880.          B     DSKLKPSL                                        @SC90264 05939500
  1881. DSKLKSG  ST    1,DSKSECPL    Ptr to TSUTE                      @SC90264 05940000
  1882.          TM    TSUTETC,TSUTEGID  Is group id bit on?           @ML90264 05940500
  1883.          BO    DSKLKFND      Yes, all is well                  @SC90264 05941000
  1884.          CLC   FABCOMM(5),=CL8'OPEN I'                         @SC90264 05941500
  1885.          BE    DSKER1        Don't do it after all             @SC90264 05942000
  1886. DSKLKFND CLR   2,2           Set CC=Z                          @SC90264 05942500
  1887.          BR    2                                               @SC90264 05943000
  1888. DSKLKNF  CLI   *,0           Indicate error                    @SC90264 05943500
  1889.          BR    2                                               @SC90264 05944000
  1890.          DROP  1,9                                             @SC90264 05944500
  1891. DSKLKPD  L     1,CSAPTR                                        @SC90264 05945000
  1892.          L     DCTCBAR,CSADCTBA-DFHCSABA(,1) Start of DCT table@SC90264 05945500
  1893. DSKLKPL  CLI   TDDCTDID,254  Reached end?                      @SC90264 05946000
  1894.          BHR   2             Yes, return CC=H                  @SC90264 05946500
  1895.          CLC   TDDCTDID,FABFNAM    Found match?                @SC90264 05947000
  1896.          BE    DSKLKDI             Yes, verify contents        @SC90264 05947500
  1897.          AH    DCTCBAR,TDDCTELN    No, on to next item         @SC90264 05948000
  1898.          B     DSKLKPL                                         @SC90264 05948500
  1899. DSKLKDI  ST    DCTCBAR,DSKSECPL    Ptr to DCT                  @SC90264 05949000
  1900.          MVC   FDBFL2,TDDCTDT  Copy flags so we'll remember    @SC91150 05949500
  1901.          TM    TDDCTDT,TDINDTBM    INTRA?                      @SC90264 05950000
  1902.          BZ    DSKLKDX       No, check EXTRA                   @SC90264 05950500
  1903.          CLC   TDDCTTQC,F0   Yes, any records in it?           @SC90264 05951000
  1904.          BE    DSKLKNF       None, say "not found"             @SC90264 05951500
  1905.          B     DSKLKFND                                        @SC90264 05952000
  1906. DSKLKDX  TM    TDDCTDT,TDEXTRBM EXTRA?                         @SC90264 05952500
  1907.          MVI   FDBRCF,C'V'   Enforce RECFM=V if INTRA          @SC91150 05953000
  1908.          BZR   2             No, say "found"                   @SC90264 05953500
  1909.          L     15,TDDCTSDS   Ptr to SDSCI                      @SC90264 05954000
  1910.          USING DCTSDSCI,15                                     @SC90264 05954500
  1911.          MVC   FDBXRCF,DCTSDSRF RECFM from extra TD            @SC90264 05955000
  1912.          MVC   FDBXLRC,DCTSDSRL LRECL                          @SC90264 05955500
  1913.          MVC   FDBXBLK,DCTSDSBL BLKSI                          @SC90264 05956000
  1914.          CLC   FABCOMM(5),=CL8'OPEN I'                         @SC90264 05956500
  1915.          BNE   DSKLKDA       Not going to open it              @SC90264 05957000
  1916.          OI    FDBFLGS,SVATT Must observe predefined attrs     @SC91150 05957500
  1917.          LA    9,C'O'                                          @SC90264 05958000
  1918.          TM    DCTSDSTF,DCTSDSOP  Output?                      @SC90264 05958500
  1919.          BO    *+8           Yes                               @SC90264 05959000
  1920.           LA   9,C'I'        No, input                         @SC90264 05959500
  1921.          CLM   9,1,FABCOMM+5 Does it match data set?           @SC90264 05960000
  1922.          BNE   DSKER1        No, we're in trouble              @SC90264 05960500
  1923. DSKLKDA  TM    DCTSDSTF,DCTSDSOP  Output?                      @SC90264 05961000
  1924.          BO    DSKLKFND      Yes, can just say "found"         @SC90264 05961500
  1925.          BAL   9,DSKTDOPE                                      @SC90264 05962000
  1926.           B    DSKLKNF       Failed, say it's not there        @SC90264 05962500
  1927.          EXEC CICS READQ TD QUEUE(FABFNAM) SET(1),             @SC90264+05963000
  1928.                LENGTH(FABNORD) NOHANDLE,                       @SC90264 05963500
  1929.          BAL   14,DSKCHKER   Test success                      @SC90264 05964000
  1930.          BR    2             Return indication                 @SC90264 05964500
  1931. * Handle internal file                                         @SC90264 05965000
  1932. DSKLKTK  KCALL KFLLKP,(3)                                      @SC90264 05965500
  1933.          ST    1,DSKSECPL    Ptr to KFS block                  @SC90264 05966000
  1934.          LTR   15,15                                           @SC90264 05966500
  1935.          BR    2                                               @SC90264 05967000
  1936. * Handle pipe (also called by other disk operations)           @SC90264 05967500
  1937. DSKLKPG  LA    8,FABFNAM     Point to pgm in FAB               @SC90264 05968000
  1938.          TM    FABFLGS,FABFPGM General pipe?                   @SC90264 05968500
  1939.          BO    *+8           Yes, use that                     @SC90264 05969000
  1940.           LA   8,=CL8'IKXDYNAL'                                @SC90264 05969500
  1941.          ICM   9,15,=A(KHOST)                                  @SC90264 05970000
  1942.          BZ    DSKLKPGX                                        @SC90264 05970500
  1943.          LR    14,8                                            @SC90264 05971000
  1944.          LR    15,3          String address                    @SC90264 05971500
  1945.          LA    0,DSKFABLN    Ptr to length                     @SC90264 05972000
  1946.          STM   14,0,DSKSECPL Set up calling sequence           @SC90264 05972500
  1947.          KCALL (9),DSKSECPL,EXT,E=0(,2)                        @SC90264 05973000
  1948. DSKLKPGX CLC   =CL8'IKXDYNAL',0(8)                             @SC90264 05973500
  1949.          BNE   DSKLKPGZ      General pipe                      @SC90264 05974000
  1950.          TM    DSKFL,PLOAD   Pgm loaded?                       @SC90264 05974500
  1951.          BO    DSKLKPGZ      Yes, we're all set                @SC90264 05975000
  1952.          OI    DSKFL,PLOAD   Mark pgm loaded                   @SC90264 05975500
  1953. DSKLKPGY EXEC CICS LOAD PROGRAM(0(,8)) NOHANDLE,               @SC90264 05976000
  1954. DSKLKPGZ EXEC CICS LINK PROGRAM(0(,8)) COMMAREA(0(,3)),        @SC90264+05976500
  1955.                LENGTH(DSKFABLN+2) NOHANDLE,                    @SC90264 05977000
  1956.          L     15,DFHEIBP    Set up to copy EIB code           @SC90264 05977500
  1957.          USING DFHEIBLK,15                                     @SC90264 05978000
  1958.          CLC   F0,EIBRCODE   Did the LINK work?                @SC90264 05978500
  1959.          BE    *+10          Yes                               @SC90264 05979000
  1960.           MVC  FABRESP,EIBRCODE  No, save error code           @SC90264 05979500
  1961.          DROP  15                                              @SC90264 05980000
  1962.          CLC   F0,FABRESP    Did the operation work?           @SC90264 05980500
  1963.          BR    2                                               @SC90264 05981000
  1964. *                                                                       05981500
  1965. * Set up search through list of files, pattern at (R1)                  05982000
  1966. DSKNSET  DS    0H                                              @SC89073 05982500
  1967.          MVC   NXDEST,0(1)                                     @SC90264 05983000
  1968.          TM    0(1),FABFTS+FABFTD TS and TD are in memory      @SC90264 05983500
  1969.          BNZ   DSKNSX        Go scan list                      @SC90264 05984000
  1970.          TM    0(1),FABFTAK                                    @SC90264 05984500
  1971.          BZ    DSKNSWLD      Not one of the types in memory    @SC90264 05985000
  1972.          CLC   CURFUID,1(1)  TAKE in memory only if current    @SC90264 05985500
  1973.          BE    DSKNSX        Yes, go scan list                 @SC90264 05986000
  1974. DSKNSWLD DS    0H                                              @SC90264 05986500
  1975.          MVI   TRTBL+C'%',1  Want to catch a percent           @SC86115 05987000
  1976.          MVI   TRTBL+C'*',1  Want to catch an asterisk         @SC86115 05987500
  1977.          TRT   LFUID+1(LFFNM,1),TRTBL  See if anything wild    @SC90264 05988000
  1978.          MVI   TRTBL+C'%',0  Restore TRTBL                     @SC86115 05988500
  1979.          MVI   TRTBL+C'*',0                                    @SC86115 05989000
  1980.          BZ    DSKNSX        No wild chars found, ok           @SC90264 05989500
  1981.          CLI   0(1),C' '     Did we just run off the end?      @SC90264 05990000
  1982.          BNE   RTRN1         Wild char.  Can't handle for TS   @SC90264 05990500
  1983. *                                                                       05991000
  1984. * Flush previous file pattern                                           05991500
  1985. DSKNSX   MVC   NXPTR,=X'80000000'                              @SC90264 05992000
  1986.          L     9,NXPTR2                                        @SC91150 05992500
  1987. DSKNSX1  LTR   9,9                                             @SC91150 05993000
  1988.          BZ    RTRN0         No more blocks                    @SC91150 05993500
  1989.          L     9,TSUTFC-DFHTSUT(,9)                            @SC91150 05994000
  1990.          L     6,NXPTR2      Free old fake block               @SC91150 05994500
  1991.          EXEC CICS FREEMAIN DATA(0(,6)),                       @SC91150 05995000
  1992.          ST    9,NXPTR2      Reset ptr to current block        @SC91150 05995500
  1993.          B     DSKNSX1                                         @SC91150 05996000
  1994. *                                                                       05996500
  1995. * Check CWD string, return code in R15                                  05997000
  1996. DSKCWDF  DS    0H                                              @SC89073 05997500
  1997.          LA    3,DSKSTT                                        @SC90264 05998000
  1998.          MVC   FABFID,0(1)   Copy as much as possible of string@SC90264 05998500
  1999.          MVC   FABCOMM,=CL8'CWD'                               @SC90264 05999000
  2000.          BAL   2,DSKVALID    Check if allowed                  @SC90264 05999500
  2001.          CLI   FABFID+2,C'''' DSN?                             @SC90264 06000000
  2002.          BE    RTRN0         Yes, it can be anything           @SC90264 06000500
  2003.          LA    0,LFUID       No, must be userid                @SC90264 06001000
  2004.          CLM   0,3,FABFID    Is it the right length?           @SC90264 06001500
  2005.          BL    RTRN1         Too long, reject it               @SC90264 06002000
  2006.          B     RTRN0         Ok                                @SC90264 06002500
  2007. *                                                                       06003000
  2008. * Check disk space for proposed file: FDB at (R1), FAB ptr at (R6)      06003500
  2009. DSKTSP   L     5,FDBSIZE-FDBD(,1)  Get actual size             @SC90037 06004000
  2010.          ICM   3,15,0(6)     Get FAB ptr                       @SC90037 06004500
  2011.          BZ    DSKTSPX       Not open yet                      @SC90037 06005000
  2012. DSKTSP0  DS    0H                                              @SC90037 06005500
  2013.          TM    FABFLGS,FABFTAK Internal file?                  @SC90264 06006000
  2014.          BZ    RTRN0         No, can't say how much room       @SC90264 06006500
  2015.          CLC   FABFUID,CURFUID Current directory?              @SC90264 06007000
  2016.          BNE   RTRN0         No, don't know about them         @SC90264 06007500
  2017.          CLC   FABFUID,SYSUID Global directory?                @SC90264 06008000
  2018.          BE    RTRN0         Yes, don't limit that             @SC90264 06008500
  2019.          L     1,LIMKFS      Total allowed                     @SC90264 06009000
  2020.          SL    1,USRTOTL     Amount already used               @SC90264 06009500
  2021.          SRL   1,10          Convert to Kbytes                 @SC86316 06010000
  2022.          CLR   1,5                                             @SC90037 06010500
  2023.          BL    RTRN1         No room                           @SC86316 06011000
  2024.          B     RTRN0         Ok                                @SC86316 06011500
  2025. DSKTSPX  MVC   DSKSTNM,0(2)  File not opened yet, look for it  @SC90037 06012000
  2026.          LA    3,DSKSTT      Point to temporary FAB            @SC90037 06012500
  2027.          MVC   FABCOMM,=CL8'TEST'                              @SC90264 06013000
  2028.          BAL   2,DSKLKP                                        @SC90037 06013500
  2029.          BNZ   DSKTSP0       Not found, nothing to erase       @SC90037 06014000
  2030.          MVC   FDBSIZE,F0    Clear out old size, if any        @SC90264 06014500
  2031.          BAL   14,DSKVALS    Compute size, if possible         @SC90264 06015000
  2032.          L     1,FDBSIZE     Fetch it                          @SC90264 06015500
  2033.          SR    5,1           Assume old file will be erased    @SC90037 06016000
  2034.          BNP   RTRN0         Will release enough for new file  @SC90037 06016500
  2035.          B     DSKTSP0       Not enough, check free blocks     @SC90037 06017000
  2036. *                                                                       06017500
  2037. DSKNXT   DS    0H                                              @SC89073 06018000
  2038.          XC    DSKFDB,DSKFDB Clear out info                    @SC90264 06018500
  2039.          MVC   FILNAM,NXDEST Set up full fid                   @SC90264 06019000
  2040.          LA    1,NXDEST      Ptr to pattern with flags         @SC90264 06019500
  2041.          ST    1,DSKSECPL+4  Set up call to KHIDE              @SC90264 06020000
  2042.          L     9,NXPTR2      For TS chains                     @SC90264 06020500
  2043.          ICM   1,15,NXPTR    Current ptr                       @SC90264 06021000
  2044.          BP    NXFNEXT       Already started, get next         @SC90264 06021500
  2045.          BZ    RTRN1         Nothing else there                @SC90264 06022000
  2046.          MVI   NXPTR,0       Clear to 0, in case "other"       @SC90264 06022500
  2047.          NI    DSKFL,255-WFN Nothing wild yet                  @SC90264 06023000
  2048.          L     1,CSAPTR      Access CSA                        @SC90264 06023500
  2049. * Set up for scan of specific kind of file...                  @SC90264 06024000
  2050.          TM    NXDEST,FABFTS Is it a TS?                       @SC90264 06024500
  2051.          BZ    DSKNXTTD                                        @SC90264 06025000
  2052.          USING DFHTSUT,2                                       @SC91150 06025500
  2053.          L     2,CSATSMTA-DFHCSABA(,1)  Start of TS chain      @SC91150 06026000
  2054.          LA    9,NXPTR2+DFHTSUT-TSUTFC  Start of fake chain    @SC91150 06026500
  2055. DSKNXTS0 LH    6,TSUTCC                                        @SC91150 06027000
  2056.          LTR   6,6           Any entries in this block?        @SC91150 06027500
  2057.          BZ    DSKNXTS9      No                                @SC91150 06028000
  2058.          LA    1,TSUTELN     Length of each entry              @SC91150 06028500
  2059.          MR    0,6           Compute size needed               @SC91150 06029000
  2060.          LA    1,TSUTEBA-DFHTSUT(,1)  (including control offset@SC91150 06029500
  2061.          ST    1,GTMLEN                                        @SC91150 06030000
  2062.          EXEC CICS GETMAIN FLENGTH(GTMLEN) SET(1), Get block   @SC91150 06030500
  2063.          L     7,TSUTAHI     Start of real list                @SC91150 06031000
  2064.          DROP  2                                               @SC91150 06031500
  2065.          USING DFHTSUT,9                                       @SC91150 06032000
  2066.          ST    1,TSUTFC      Add fake block to fake chain      @SC91150 06032500
  2067.          LR    9,1           Now address new block             @SC91150 06033000
  2068.          XC    TSUTFC,TSUTFC Clear next forward ptr            @SC91150 06033500
  2069.          LA    1,TSUTEBA                                       @SC91150 06034000
  2070.          ST    1,TSUTAHI     Start of fake list                @SC91150 06034500
  2071.          STH   6,TSUTCC      Set number of entries             @SC91150 06035000
  2072. DSKNXTS1 MVC   0(TSUTELN,1),0(7)  Copy one entry from real list@SC91150 06035500
  2073.          ST    1,TSUTALI     Save as if last                   @SC91150 06036000
  2074.          LA    1,TSUTELN(,1)                                   @SC91150 06036500
  2075.          LA    7,TSUTELN(,7)                                   @SC91150 06037000
  2076.          BCT   6,DSKNXTS1    Keep copying until done           @SC91150 06037500
  2077.          DROP  9                                               @SC91150 06038000
  2078.          USING DFHTSUT,2                                       @SC91150 06038500
  2079. DSKNXTS9 L     2,TSUTFC      See if another block              @SC91150 06039000
  2080.          LTR   2,2                                             @SC91150 06039500
  2081.          BNZ   DSKNXTS0      Yes, copy it as well              @SC91150 06040000
  2082.          DROP  2                                               @SC91150 06040500
  2083.          LA    7,8-1         Length of TS name                 @SC90264 06041000
  2084. *        MVC   NXPTR2,CSATSMTA-DFHCSABA(1)   Temp storage table@SC91150 06041500
  2085.          B     DSKNXT1                                         @SC90264 06042000
  2086. DSKNXTTD TM    NXDEST,FABFTD Is it a TD?                       @SC90264 06042500
  2087.          BZ    DSKNXTTT      Other                             @SC90264 06043000
  2088.          LA    7,4-1                                           @SC90264 06043500
  2089.          MVC   NXPTR,CSADCTBA-DFHCSABA(1) Start of DCT table   @SC90264 06044000
  2090.          B     DSKNXT1                                         @SC90264 06044500
  2091. DSKNXTTT TM    NXDEST,FABFTAK Is it internal?                  @SC90264 06045000
  2092.          BZ    DSKNXTTO      Other                             @SC90264 06045500
  2093.          CLC   CURFUID,NXDEST+1 TAKE in memory only if current @SC90264 06046000
  2094.          BNE   DSKNXTTO      Not current, must look up         @SC90264 06046500
  2095.          LA    7,8-1                                           @SC91150 06047000
  2096.          MVC   NXPTR,PTRKFS  Start of internal chain           @SC90264 06047500
  2097. * Setup for scan: R7=length-1 of name field, NXPTR initialized @SC90264 06048000
  2098. DSKNXT1  LA    6,NXDNAM      Start of name per se              @SC90264 06048500
  2099.          LA    1,1(7,6)      End of field                      @SC90264 06049000
  2100.          EX    7,NXFWTR      Find first blank                  @SC90264 06049500
  2101.          SR    1,6           Compute length                    @SC86295 06050000
  2102.          ST    1,NXFFNL      Length of pattern                 @SC90264 06050500
  2103.          MVI   TRTBL+C' ',0  Don't want to catch a blank       @SC86115 06051000
  2104.          MVI   TRTBL+C'%',1  Want to catch a percent           @SC86115 06051500
  2105.          MVI   TRTBL+C'*',1  Want to catch an asterisk         @SC86115 06052000
  2106.          EX    7,NXFWTR      See if any % or * in name         @SC90264 06052500
  2107.          MVI   TRTBL+C'%',0  Restore TRTBL                     @SC86115 06053000
  2108.          MVI   TRTBL+C'*',0                                    @SC86115 06053500
  2109.          MVI   TRTBL+C' ',1                                    @SC86115 06054000
  2110.          BZ    *+8           No wild chars found               @SC86295 06054500
  2111.            OI  DSKFL,WFN                                       @SC86295 06055000
  2112.          L     1,NXPTR                                         @SC90264 06055500
  2113.          L     9,NXPTR2      For TS chains                     @SC90264 06056000
  2114. NXFNEXT  TM    NXDEST,FABFTS Is it a TS?                       @SC90264 06056500
  2115.          BO    NXFNXTS       Yes, follow chains                @SC90264 06057000
  2116.          TM    NXDEST,FABFTAK Is it internal?                  @SC90264 06057500
  2117.          BO    NXFNXTT       Yes, follow chains                @SC90264 06058000
  2118. * Advance to next TD block and setup R6,R7                     @SC90264 06058500
  2119.          LR    DCTCBAR,1     Point to next item                @SC90264 06059000
  2120.          CLI   TDDCTDID,255  Reached end?                      @SC90264 06059500
  2121.          BE    RTRN1         Yes, quit                         @SC90264 06060000
  2122.          ST    1,DSKSECPL    Ptr to DCT                        @SC90264 06060500
  2123.          AH    1,TDDCTELN    No match, keep at it              @NL90264 06061000
  2124.          LA    6,TDDCTDID    Start of field                    @SC90264 06061500
  2125.          LA    7,4-1         Length of field                   @SC90264 06062000
  2126.          B     NXFCHK        Now compare names                 @SC90264 06062500
  2127. * Advance to next internal file and setup R6,R7                @SC90264 06063000
  2128.          USING KFSBLK,9                                        @SC90264 06063500
  2129. NXFNXTT  LTR   9,1           Reached end?                      @SC90264 06064000
  2130.          BZ    RTRN1         Yes, quit                         @SC90264 06064500
  2131.          ST    1,DSKSECPL    Ptr to KFS block                  @SC90264 06065000
  2132.          L     1,KFSNEXT     Ptr to next one                   @NL90264 06065500
  2133.          LA    6,KFSFNAM     Start of field                    @SC90264 06066000
  2134.          LA    7,8-1         Length of field                   @SC90264 06066500
  2135. NXFCHK   ST    1,NXPTR       Save the ptr for the next         @SC90264 06067000
  2136.          STM   6,7,DSKCURN   Save ptr,len-1 of current name    @SC90264 06067500
  2137.          TM    DSKFL,WFN                                       @SC86295 06068000
  2138.          BO    NXFWF         Go if wild                        @SC86295 06068500
  2139.          CLC   0(,6),NXDNAM                                    @SC90264 06069000
  2140.          EX    7,*-6         Compare name                      @SC90264 06069500
  2141.          BNE   NXFNEXT       Keep trying                       @SC90264 06070000
  2142. NXFHAVE  LA    14,FILNAM+LFUID+1                               @SC90264 06070500
  2143.          LA    15,LFFNM      Length of name part               @SC90264 06071000
  2144.          LM    6,7,DSKCURN   Get ptr,len-1                     @SC90264 06071500
  2145.          LA    7,1(,7)       Convert to length                 @SC90264 06072000
  2146.          ICM   7,8,BLANK                                       @SC90264 06072500
  2147.          MVCL  14,6          Copy to FILNAM with blank padding @SC90264 06073000
  2148.          MVC   DSKSTNM,FILNAM                                  @SC90264 06073500
  2149.          LA    3,DSKSTT                                        @SC86295 06074000
  2150.          TM    FABFLGS,FABFTD TD queue?                        @SC91150 06074500
  2151.          BZ    NXFHVAL       No, we're fine                    @SC91150 06075000
  2152.          TM    TDDCTDT,TDEXTRBM EXTRA?                         @SC91150 06075500
  2153.          BZ    NXFHVAL       No, we're fine                    @SC91150 06076000
  2154.          L     15,TDDCTSDS   Ptr to SDSCI                      @SC91150 06076500
  2155.          USING DCTSDSCI,15                                     @SC91150 06077000
  2156.          MVC   FDBXRCF,DCTSDSRF RECFM from extra TD            @SC91150 06077500
  2157.          MVC   FDBXLRC,DCTSDSRL LRECL                          @SC91150 06078000
  2158.          MVC   FDBXBLK,DCTSDSBL BLKSI                          @SC91150 06078500
  2159.          DROP  15                                              @SC91150 06079000
  2160. NXFHVAL  DS    0H                                              @SC91150 06079500
  2161.          BAL   14,DSKVALS    Copy out quantities               @SC86295 06080000
  2162.          B     RTRN0                                           @SC86295 06080500
  2163. DSKNXTTO MVC   DSKSTNM,FILNAM Other types: just do one         @SC90264 06081000
  2164.          LA    3,DSKSTT                                        @SC86295 06081500
  2165.          MVC   FABCOMM,=CL8'TEST'                              @SC90264 06082000
  2166.          BAL   2,DSKLKP      Can't scan blocks, must look up   @SC90264 06082500
  2167.          BNZ   RTRN1         File not found                    @SC90264 06083000
  2168.          BAL   14,DSKVALS    Copy out quantities               @SC86295 06083500
  2169.          B     RTRN0                                           @SC86295 06084000
  2170. * Advance to next TS block and setup R6,R7                     @SC90264 06084500
  2171.          USING DFHTSUT,9                                       @SC90264 06085000
  2172.          USING DFHTSUTE,1                                      @SC90264 06085500
  2173. NXFNXTS  LTR   1,1                                             @SC90264 06086000
  2174.          BNP   NXFNXTSL                                        @SC90264 06086500
  2175.          C     1,TSUTALI     Any more on chain?                @SC90264 06087000
  2176.          BNL   NXFNXTSN                                        @SC90264 06087500
  2177.          LA    1,TSUTELN(,1) Check next entry                  @SC90264 06088000
  2178. NXFNXTS1 TM    TSUTETC,TSUTEGID  Is group id bit on?           @ML90264 06088500
  2179.          BZ    NXFNXTS       No, skip this one                 @SC90264 06089000
  2180.          LA    6,TSUTEID                                       @SC90264 06089500
  2181.          LA    7,8-1                                           @SC90264 06090000
  2182.          ST    1,DSKSECPL    Ptr to TSUTE                      @SC90264 06090500
  2183.          B     NXFCHK                                          @SC90264 06091000
  2184. NXFNXTSN L     9,TSUTFC                                        @SC90264 06091500
  2185.          L     6,NXPTR2      Free old fake block               @SC91150 06092000
  2186.          EXEC CICS FREEMAIN DATA(0(,6)),                       @SC91150 06092500
  2187.          ST    9,NXPTR2                                        @SC90264 06093000
  2188. NXFNXTSL MVC   NXPTR,F0                                        @SC90264 06093500
  2189.          LTR   9,9                                             @SC90264 06094000
  2190.          BZ    RTRN1         Not found                         @SC90264 06094500
  2191.          CLC   TSUTCC,F0     Test for no entries               @SC90264 06095000
  2192.          BE    NXFNXTSN                                        @SC90264 06095500
  2193.          L     1,TSUTAHI     First on chain                    @SC90264 06096000
  2194.          B     NXFNXTS1                                        @SC90264 06096500
  2195.          DROP  1,9                                             @SC90264 06097000
  2196. *                                                                       06097500
  2197. NXFWTR   TRT   0(,6),TRTBL   Look for first blank              @SC90264 06098000
  2198. NXFWF    ICM   15,15,=A(KHIDE)  Check for secret names?        @SC90264 06098500
  2199.          BZ    NXFWF2        Not needed                        @SC90264 06099000
  2200.          KCALL (15),DSKSECPL,EXT See if it's allowed           @SC90264 06099500
  2201.          L     1,NXPTR       Restore R1                        @SC90264 06100000
  2202.          BNZ   NXFNEXT       Skip it if not                    @SC90264 06100500
  2203. NXFWF2   LA    1,1(7,6)      End of field                      @SC90264 06101000
  2204.          EX    7,NXFWTR      Find first blank                  @SC90264 06101500
  2205.          SR    1,6           Compute length                    @SC86295 06102000
  2206.          LR    7,1           Save length                       @SC86295 06102500
  2207.          LA    14,NXDNAM     Start of name per se              @SC90264 06103000
  2208.          L     15,NXFFNL     Length of pattern                 @SC90264 06103500
  2209.          L     1,NXPTR       Restore ptr to next block         @SC90264 06104000
  2210. *                                                                       06104500
  2211. * Enter here: R14,R15 contain the pattern address and length   @SC90264 06105000
  2212. *              and R6,R7 the source address and length         @SC90264 06105500
  2213. *  No other registers are used                                 @SC90264 06106000
  2214.          NI    DSKFL,255-WARB Haven't seen any of these        @SC86295 06106500
  2215.          ICM   7,8,=C'*'     Use * as the fill char                     06107000
  2216. WLDLOOP  CLCL  14,6          Compare them                      @SC90264 06107500
  2217.          BE    NXFHAVE       They're equal, fine               @SC86295 06108000
  2218. *                                                                       06108500
  2219. * String mismatch - so examine offending pattern character.  If not     06109000
  2220. * % or * and we haven't seen any * yet, we fail.  If it's % we just     06109500
  2221. * skip it; if it's * we skip it and remember we've seen it.  Else       06110000
  2222. * back up to one past the last * and try again.                         06110500
  2223.          CLI   0(14),C'%'                                      @SC90264 06111000
  2224.          BE    WLDLEN1       Go if % = LEN(1) pattern                   06111500
  2225.          CLI   0(14),C'*'                                      @SC90264 06112000
  2226.          BE    WLDARB        Go if * = ARB pattern                      06112500
  2227.          TM    DSKFL,WARB                                      @SC86295 06113000
  2228.          BZ    NXFNEXT       Go if ARB already seen            @SC86295 06113500
  2229.          CLM   7,7,F0        More data to compare?                      06114000
  2230.          BE    NXFNEXT       Go if exhausted                   @SC86295 06114500
  2231.          LM    14,15,WLDPAT  Restore addr of old ARB char      @SC90264 06115000
  2232.          LM    6,7,WLDSRC    Restore source addr too           @SC90264 06115500
  2233.          LA    6,1(,6)       Push one past                     @SC90264 06116000
  2234.          BCTR  7,0           Decrement length                           06116500
  2235.          STM   6,7,WLDSRC    Store changed addr                         06117000
  2236.          B     WLDLOOP       And go compare again.                      06117500
  2237. *                                                                       06118000
  2238. WLDLEN1  LA    14,1(,14)     Increment pattern addr            @SC90264 06118500
  2239.          BCTR  15,0          Decrement pattern len             @SC90264 06119000
  2240.          CLM   7,7,F0        Length to compare more            @SC86119 06119500
  2241.          BE    NXFNEXT       None, pattern '%' is extra        @SC86119 06120000
  2242.          LA    6,1(,6)       Increment source addr             @SC90264 06120500
  2243.          BCTR  7,0           Decrement source len                       06121000
  2244.          CLM   7,7,F0        Length to compare more            @SC86119 06121500
  2245.          BNE   WLDLOOP       Go if more data                            06122000
  2246.          LTR   15,15         Anything more in pattern?         @SC90264 06122500
  2247.          BZ    NXFHAVE       No, it's a match                  @SC86295 06123000
  2248.          CLI   0(14),C'*'                                      @SC90264 06123500
  2249.          BE    WLDLOOP       Go if ARB                                  06124000
  2250.          B     NXFNEXT       Failed                            @SC86295 06124500
  2251. *                                                                       06125000
  2252. * If pattern ends in ARB, then it will match anything.  So return to    06125500
  2253. * caller if the pattern is exhausted.                                   06126000
  2254. WLDARB   OI    DSKFL,WARB    Remember we saw one               @SC86295 06126500
  2255.          LA    14,1(,14)     Pass the ARB                      @SC90264 06127000
  2256.          BCTR  15,0          Decrement its length              @SC90264 06127500
  2257.          LTR   15,15         Any more left?                    @SC90264 06128000
  2258.          BZ    NXFHAVE       No, it's a match                  @SC86295 06128500
  2259.          STM   14,15,WLDPAT  Save pattern ptrs                 @SC90264 06129000
  2260.          STM   6,7,WLDSRC    Save source ptrs                  @SC90264 06129500
  2261.          B     WLDLOOP                                                  06130000
  2262. *                                                                       06130500
  2263. *  Fill in FDB from DCT or TSUTE or KFSBLK (ptr in DSKSECPL)   @SC90264 06131000
  2264. *  Clobbers 0,1,2,6,7,8,15.  Returns via 14.  (note DCTCBAR=8) @SC90264 06131500
  2265. DSKVALS  LA    0,FDBD        Ptr to FDB                        @SC86295 06132000
  2266.          RETREG (1,0)        Return (0) as R1 to caller        @SC89218 06132500
  2267.          MVI   FDBRCF,C'V'   Usually V                         @SC90264 06133000
  2268.          L     1,FDBBSIZ     Use max length by default         @SC90264 06133500
  2269.          TM    FABFLGS,FABFTS                                  @SC90264 06134000
  2270.          BZ    DSKVLTT       Not temp stor                     @SC90264 06134500
  2271.          L     15,DSKSECPL   Ptr to TSUTE                      @SC90264 06135000
  2272.          USING DFHTSUTE,15                                     @SC90264 06135500
  2273.          MVC   TMPDW+7(1),TSUTETC Save flags                   @SC90264 06136000
  2274.          L     15,TSUTEPTR   Ptr to TSGID                      @SC90264 06136500
  2275.          USING DFHTSGID,15                                     @SC90264 06137000
  2276.          MVC   FDBNREC,TSGIDTR Grab record count               @SC90264 06137500
  2277.          TM    TMPDW+7,TSUTEASI+TSUTEVSI                       @SC90264 06138000
  2278.          BZ    DSKVLR        Neither main nor aux?             @SC90264 06138500
  2279.          SR    0,0                                             @SC90264 06139000
  2280.          ST    0,TMPDW                                         @SC90264 06139500
  2281.          SR    6,6           Clear tentative LRECL             @SC91150 06140000
  2282. DSKVLSLP LH    2,KTSGIDNE    Number of entries/block           @SC91150 06140500
  2283.          LA    7,TSGIDEBA    Start of record ptrs              @SC90264 06141000
  2284. DSKVLSLQ MVC   TMPDW+3(1),3(7) Copy segment count              @SC90264 06141500
  2285.          TM    TMPDW+7,TSUTEASI AUX?                           @SC90264 06142000
  2286.          BO    DSKVLSA       Yes, use segment count            @SC90264 06142500
  2287.          TM    0(7),X'7F'    No.  Above the 16M line?          @SC91150 06143000
  2288.          BNZ   DSKVLR        Yes, can't calculate              @SC91150 06143500
  2289.          ICM   8,7,1(7)      Ok, get ptr to record block       @SC91150 06144000
  2290.          BZ    DSKVLSB       No more ptrs, just round off      @SC91150 06144500
  2291.          MVC   TMPDW+2(2),20(8) Grab length of record          @SC91150 06145000
  2292. DSKVLSA  A     0,TMPDW       Accumulate total in R0            @SC90264 06145500
  2293.          C     6,TMPDW       Get maximum record size           @SC91150 06146000
  2294.          BNL   *+8                                             @SC91150 06146500
  2295.           L    6,TMPDW       New maximum                       @SC91150 06147000
  2296.          LA    7,4(,7)                                         @SC90264 06147500
  2297.          BCT   2,DSKVLSLQ                                      @SC90264 06148000
  2298.          ICM   15,15,TSGIDFC Next group of records             @SC90264 06148500
  2299.          BNZ   DSKVLSLP                                        @SC90264 06149000
  2300.          TM    TMPDW+7,TSUTEASI AUX?                           @SC90264 06149500
  2301.          BZ    DSKVLSB       No, use byte count as is          @SC90264 06150000
  2302.          IC    15,KTSBPSEG   Log(seg size)                     @SC91150 06150500
  2303.          SLL   0,0(15)       Convert segments to bytes         @SC90264 06151000
  2304.          SLL   6,0(15)       Ditto for max record length       @SC91150 06151500
  2305. DSKVLSB  AL    0,=F'512'     Round up                          @SC90264 06152000
  2306.          SRL   0,10          Convert to Kbytes                 @SC90264 06152500
  2307.          ST    0,FDBSIZE                                       @SC90264 06153000
  2308.          LR    1,6           Use observed max length for LRECL @SC91150 06153500
  2309.          B     DSKVLR                                          @SC90264 06154000
  2310. DSKVLTT  TM    FABFLGS,FABFTAK                                 @SC90264 06154500
  2311.          BZ    DSKVLTD       Not internal file                 @SC90264 06155000
  2312.          L     15,DSKSECPL   Ptr to KFSBLK                     @SC90264 06155500
  2313.          USING KFSBLK,15                                       @SC90264 06156000
  2314.          LH    1,KFSLRC      Use actual LRECL                  @SC90264 06156500
  2315.          MVC   FDBNREC,KFSNREC Grab record count               @SC90264 06157000
  2316.          MVC   FDBDATE,KFSDATE Copy date/time                  @SC90264 06157500
  2317.          L     0,KFSSIZE     Get file size in bytes            @SC90264 06158000
  2318.          AL    0,=F'512'     Round up                          @SC90264 06158500
  2319.          SRL   0,10          Convert to Kbytes                 @SC90264 06159000
  2320.          ST    0,FDBSIZE     Copy to FDB                       @SC90264 06159500
  2321.          B     DSKVLR                                          @SC90264 06160000
  2322.          DROP  15                                              @SC91150 06160500
  2323. DSKVLTD  DS    0H                                              @SC90264 06161000
  2324.          TM    FABFLGS,FABFSPL                                 @SC90264 06161500
  2325.          BO    DSKVLTX2      Spool file, use FDBX info         @SC90264 06162000
  2326.          TM    FABFLGS,FABFTD                                  @SC90264 06162500
  2327.          BZ    DSKVLR        Other                             @SC90264 06163000
  2328.          L     DCTCBAR,DSKSECPL  Ptr to info                   @SC90264 06163500
  2329.          MVC   FDBFL2,TDDCTDT  Copy flags                      @SC90264 06164000
  2330.          XC    FDBSIZE,FDBSIZE Clear size (unknown)            @SC90264 06164500
  2331.          TM    FDBFL2,TDINDTBM  Intra?                         @SC90264 06165000
  2332.          BZ    DSKVLTX       No, see if Extra                  @SC90264 06165500
  2333.          MVC   FDBNREC,TDDCTTQC+2 Yes, grab record count       @SC91150 06166000
  2334.          B     DSKVLR        Ok, we're done                    @SC90264 06166500
  2335. DSKVLTX  DS    0H                                              @SC90264 06167000
  2336.          TM    FDBFL2,TDEXTRBM  Extra?                         @SC90264 06167500
  2337.          BNO   DSKVLR        No                                @SC90264 06168000
  2338. DSKVLTX2 MVI   FDBRCF,C'U'                                     @SC86299 06168500
  2339.          LH    1,FDBXBLK     Use BLKSI if U                    @SC90264 06169000
  2340.          TM    FDBXRCF,X'C0'                                   @SC90264 06169500
  2341.          BO    DSKVLR                                          @SC86299 06170000
  2342.          LH    1,FDBXLRC     Use LRECL if F or V               @SC90264 06170500
  2343.          LTR   1,1           Make sure it's defined            @SC91150 06171000
  2344.          BP    *+8           Yes, ok                           @SC91150 06171500
  2345.           LH   1,FDBLRC      No, keep old LRECL                @SC91150 06172000
  2346.          MVI   FDBRCF,C'F'                                     @SC86299 06172500
  2347.          TM    FDBXRCF,X'80'                                   @SC90264 06173000
  2348.          BO    DSKVLR                                          @SC86299 06173500
  2349.          MVI   FDBRCF,C'V'                                     @SC86299 06174000
  2350. DSKVLR   STH   1,FDBLRC                                        @SC86299 06174500
  2351.          L     7,4(13)       Get previous stack frame          @SC88048 06175000
  2352.          L     1,4(7)        and the one before                @SC88076 06175500
  2353.          CLC   =A(SERVER),16(1) Was the caller SERVER?         @SC89215 06176000
  2354.          BE    *+12          Yes, ok                           @SC88076 06176500
  2355.           CLC  =A(USNTRF),16(1) No, was it USNTRF?             @SC89215 06177000
  2356.           BNER 14            No, don't bother checking TAKE's  @SC88076 06177500
  2357.          USING SERVERSV,7    Assume SERVER or USNTRF           @SC88048 06178000
  2358.          ICM   0,15,TAKLEV   Any TAKE files open?              @SC88048 06178500
  2359.          BNPR  14            No, that's fine                   @SC88048 06179000
  2360.          CH    0,=Y(TAKMAX)  Be sure this is valid             @SC88048 06179500
  2361.          BNLR  14            Oops, give up                     @SC88048 06180000
  2362. DSKVACT  LR    6,0                                             @SC88048 06180500
  2363.          SLA   6,2                                             @SC88048 06181000
  2364.          L     6,TAKTAB-4(6) Fetch a file ticket               @SC88048 06181500
  2365.          CLC   FABFID,FABFID-FABD(6) Does the name match?      @SC88048 06182000
  2366.          BE    DSKVACS       Yes, this file is in use          @SC88048 06182500
  2367.          BCT   0,DSKVACT     No, keep looking                  @SC88048 06183000
  2368.          BR    14            No match, that's ok               @SC88048 06183500
  2369. DSKVACS  OI    FDBFLGS,FDBACTV Yes, turn on flag               @SC88048 06184000
  2370.          BR    14                                              @SC86295 06184500
  2371.          DROP  7                                               @SC91150 06185000
  2372. *                                                                       06185500
  2373.          DROP  3,5,DCTCBAR                                     @SC91150 06186000
  2374. *                                                                       06186500
  2375. DSKFABLN DC    A(FABDWDS*8)  Length of FAB                     @SC90264 06187000
  2376.          LOCALS ,                                              @SC86295 06187500
  2377. DSKEMTS  DS    0CL15'SET Q(    ) CLO'                          @ML90264 06188000
  2378. WLDPAT   DS    A             Place in pattern of last ARB               06188500
  2379.          DS    F             Length of pattern past ARB                 06189000
  2380. WLDSRC   DS    A             Place in source when ARB seen              06189500
  2381.          DS    F             Length of source past WLDSRC               06190000
  2382. DSKCPPTR DS    0A            Ticket for COPY output            @SC90264 06190500
  2383. NUMPAT   DS    CL8           Work area for sequence numbers    @SC90264 06191000
  2384. DSKSECPL DS    3A            Plist for KHIDE or KHOST          @SC90264 06191500
  2385. DSKCURN  DS    2F            Saved ptrs during DIR scan        @SC90264 06192000
  2386. DSKCOD   DS    X             Saved DISKIO function code        @SC90264 06192500
  2387. *                                                                       06193000
  2388.          EXIT                                                           06193500
  2389.          TITLE 'KFILIO Routine - performs disk I/O functions'  @SC90264 06194000
  2390. * ERRNUM unchanged unless there is a disk error.               @SC90264 06194500
  2391. * Function selected on entry by FABCOMM (pointed to by R1)     @SC90264 06195000
  2392. KFILIO   ENTER ,                                               @SC90264 06195500
  2393.          USING FABD,3                                          @SC90264 06196000
  2394.          USING KFSBLK,4                                        @SC90264 06196500
  2395.          USING DFHEIBLK,8                                      @SC90264 06197000
  2396.          L     8,DFHEIBP     Get addressability                @SC90264 06197500
  2397.          LR    3,1                                             @SC90264 06198000
  2398.          XC    FABRESP,FABRESP Clear error code                @SC90264 06198500
  2399.          LH    1,FABRN       Convert rec no for key            @SC90264 06199000
  2400.          CVD   1,KFLDW                                         @SC90264 06199500
  2401.          OI    KFLDW+7,15                                      @SC90264 06200000
  2402.          UNPK  KFLRN,KFLDW                                     @SC90264 06200500
  2403.          MVC   KFLFUID(LFUID+LFFNM),FABFUID Copy name for key  @SC90264 06201000
  2404.          LM    6,7,FDBBUFF   Adr and len of buffer             @SC90264 06201500
  2405.          STH   7,FABNORD     Set up for read/write             @SC90264 06202000
  2406.          L     4,FABUWORD    Ptr to KFSBLK                     @SC90264 06202500
  2407. * Read a record                                                @SC90264 06203000
  2408.          CLC   =C'READ',FABCOMM                                @SC90264 06203500
  2409.          BNE   KFLWRT                                          @SC90264 06204000
  2410.          EXEC CICS READ DATASET(KFILE) RIDFLD(KFLFUID),        @SC90264+06204500
  2411.                INTO(0(,6)) LENGTH(FABNORD) NOHANDLE,           @SC90264 06205000
  2412.          CLC   F0,EIBRCODE   Any error?                        @SC90264 06205500
  2413.          BNE   KFLRDX        Yes, note it                      @SC90264 06206000
  2414.          LA    1,LFKEY       Length of key                     @SC90264 06206500
  2415.          LH    7,FABNORD     Actual read length                @SC90264 06207000
  2416.          SR    7,1           Deduct                            @SC90264 06207500
  2417.          STH   7,FABNORD     Data length                       @SC90264 06208000
  2418.          LA    0,0(1,6)      Start of real data                @SC90264 06208500
  2419.          LR    1,7                                             @SC90264 06209000
  2420.          MVCL  6,0           Move everything back              @SC90264 06209500
  2421.          B     RTRN0                                           @SC90264 06210000
  2422. KFLRDX   MVC   FABRESP,EIBRCODE                                @SC90264 06210500
  2423.          B     RTRN1                                           @SC90264 06211000
  2424. * Write a record                                               @SC90264 06211500
  2425. KFLWRT   CLC   =C'WRITE',FABCOMM                               @SC90264 06212000
  2426.          BNE   KFLDEL                                          @SC90264 06212500
  2427.          LR    0,7           Length of record                  @SC90264 06213000
  2428.          AL    0,KFSSIZE     Accumulate file size              @SC90264 06213500
  2429.          BC    12,*+8                                          @SC90264 06214000
  2430.           SR   0,0                                             @SC90264 06214500
  2431.           BCTR 0,0           Set to max if carry               @SC90264 06215000
  2432.          ST    0,KFSSIZE     New size                          @SC90264 06215500
  2433.          CH    7,KFSLRC      Check for max lrecl               @SC90264 06216000
  2434.          BNH   *+8                                             @SC90264 06216500
  2435.           STH  7,KFSLRC      New max lrecl                     @SC90264 06217000
  2436. *------------------------- Quota checking ------------         @SC90264 06217500
  2437.          CLC   FABFUID,CURFUID Current userid?                 @SC90264 06218000
  2438.          BNE   KFLWRT1       No, assume it's ok                @SC90264 06218500
  2439.          CLC   FABFUID,SYSUID Global directory?                @SC90264 06219000
  2440.          BE    KFLWRT1       Yes, never limit that             @SC90264 06219500
  2441.          AL    0,USRTOTL     Get new total assuming success    @SC90264 06220000
  2442.          BC    3,KFLWRX      Way too big                       @SC90264 06220500
  2443.          CL    0,CUTKFS      See if over cutoff limit          @SC90264 06221000
  2444.          BC    3,KFLWRX      Yes, too big                      @SC90264 06221500
  2445. *-------------------------                                     @SC90264 06222000
  2446. KFLWRT1  LA    1,LFKEY       Length of key                     @SC90264 06222500
  2447.          AR    7,1                                             @SC90264 06223000
  2448.          STH   7,FABNORD     Increase length                   @SC90264 06223500
  2449.          SR    6,1           And back up start of buffer       @SC90264 06224000
  2450.          MVC   0(LFKEY,6),KFLFUID Copy key into data buffer    @SC90264 06224500
  2451. KFLWRT2  EXEC CICS WRITE DATASET(KFILE) RIDFLD(KFLFUID),       @SC90264+06225000
  2452.                FROM(0(,6)) LENGTH(FABNORD) NOHANDLE,           @SC90264 06225500
  2453.          CLC   F0,EIBRCODE   Any error?                        @SC90264 06226000
  2454.          BE    RTRN0                                           @SC90264 06226500
  2455.          MVC   FABRESP,EIBRCODE                                @SC90264 06227000
  2456.          B     RTRN1                                           @SC90264 06227500
  2457. *                                                                       06228000
  2458. KFLWRX   MVI   FABRESP,X'83' Say it was NOSPACE                @SC90264 06228500
  2459.          B     RTRN1                                           @SC90264 06229000
  2460. * Delete a file                                                @SC90264 06229500
  2461. KFLDEL   CLC   =C'DELETE',FABCOMM                              @SC90264 06230000
  2462.          BNE   KFLCLO                                          @SC90264 06230500
  2463.          MVC   FABUWORD,F0   Will no longer have KFSBLK        @SC90264 06231000
  2464.          ICM   4,15,TMPBLK   Check saved temporary             @SC91150 06231500
  2465.          BZ    KFLDEL0       None set                          @SC91150 06232000
  2466.          CLC   FABFUID(LFUID+LFFNM),KFSFUID Are we killing it? @SC91150 06232500
  2467.          BNE   KFLDEL0       No, fine                          @SC91150 06233000
  2468.          MVI   KFSFUID,0     Yes, disable that block           @SC91150 06233500
  2469. KFLDEL0  DS    0H                                              @SC91150 06234000
  2470.          CLC   FABFUID,CURFUID Current directory?              @SC90264 06234500
  2471.          BNE   KFLDEL1       No, skip bookkeeping              @SC90264 06235000
  2472.          KCALL KFLLKP,(3),E=RTRN1 Find KFS block               @SC90264 06235500
  2473.          LR    4,1           Get ptr for addressability        @SC90264 06236000
  2474.          MVC   FABUWORD,F0   Will no longer have KFSBLK        @SC91150 06236500
  2475.          L     0,USRTOTL     Reduce storage total              @SC90264 06237000
  2476.          SL    0,KFSSIZE     By amount used in this file       @SC90264 06237500
  2477.          BC    3,*+6                                           @SC91150 06238000
  2478.           SLR  0,0                                             @SC90264 06238500
  2479.          ST    0,USRTOTL                                       @SC90264 06239000
  2480.          LM    6,7,KFSNEXT   Load ptrs to next and previous    @SC90264 06239500
  2481.          MVC   KFSNEXT,PTRFRE Link to free chain               @SC90264 06240000
  2482.          ST    4,PTRFRE                                        @SC90264 06240500
  2483.          ST    6,KFSNEXT-KFSBLK(,7) Skip over forward ptrs     @SC90264 06241000
  2484.          LTR   4,6           End of chain?                     @SC90264 06241500
  2485.          BZ    *+8           Yes, just unlink this one         @SC90264 06242000
  2486.           ST   7,KFSPREV     No, reattach rest of chain        @SC90264 06242500
  2487. KFLDEL1  EXEC CICS DELETE DATASET(KFILE) RIDFLD(FABFUID),      @SC90264+06243000
  2488.                KEYLENGTH(=Y(LFUID+LFFNM)) GENERIC NOHANDLE,    @SC90264 06243500
  2489.          CLC   F0,EIBRCODE   Any error?                        @SC90264 06244000
  2490.          BE    RTRN0                                           @SC90264 06244500
  2491.          B     RTRN1                                           @SC90264 06245000
  2492. * Close a file                                                 @SC90264 06245500
  2493. KFLCLO   CLC   =C'CLOSE',FABCOMM                               @SC90264 06246000
  2494.          BNE   KFLOPO                                          @SC90264 06246500
  2495.          TM    FABIOF,1      Output file?                      @SC90264 06247000
  2496.          BZ    RTRN0         No, nothing to do                 @SC90264 06247500
  2497.          CLC   FABFUID,CURFUID Current userid?                 @SC91150 06248000
  2498.          BNE   KFLCLO1       No, continue                      @SC91150 06248500
  2499.          L     0,KFSSIZE     Yes, accumulate size              @SC91150 06249000
  2500.          AL    0,USRTOTL      of current directory             @SC91150 06249500
  2501.          ST    0,USRTOTL                                       @SC91150 06250000
  2502. KFLCLO1  DS    0H                                              @SC91150 06250500
  2503.          EXEC CICS ASKTIME,                                    @SC90264 06251000
  2504.          MVC   KFSDATE+1(1),EIBDATE+1 Copy year                @SC90264 06251500
  2505.          ZAP   TMPDW,EIBDATE+2(2)                              @SC90264 06252000
  2506.          CVB   7,TMPDW       Get day-of-year in binary         @SC90264 06252500
  2507.          MVC   KFLMNTH,=AL1(30,31,30,31,31,30,31,30,31,28,31)  @SC86299 06253000
  2508.          TM    EIBDATE+1,1   Check for leap year               @SC90264 06253500
  2509.          BNZ   KFLVNLP       Not                               @SC90264 06254000
  2510.          TM    EIBDATE+1,X'12'                                 @SC90264 06254500
  2511.          BNM   KFLVNLP       Not                               @SC90264 06255000
  2512.          MVI   KFLMNTH+9,29  Leap year, change Feb.            @SC86299 06255500
  2513. KFLVNLP  LA    6,11                                            @SC86299 06256000
  2514.          SR    0,0                                             @SC86299 06256500
  2515. KFLVMDL  IC    0,KFLMNTH-1(6)                                  @SC86299 06257000
  2516.          SR    7,0           Test if passed the right month    @SC86299 06257500
  2517.          BNP   KFLVMDM       Got it                            @SC86299 06258000
  2518.          BCT   6,KFLVMDL                                       @SC86299 06258500
  2519.          SR    0,0           Hit December                      @SC86299 06259000
  2520. KFLVMDM  AR    7,0           Get day of month                  @SC86299 06259500
  2521.          LCR   6,6                                             @SC86299 06260000
  2522.          LA    6,12(6)       Get month                         @SC86299 06260500
  2523.          MH    6,=H'100'                                       @SC86299 06261000
  2524.          AR    6,7           Combine MMDD                      @SC86299 06261500
  2525.          MH    6,=H'10'                                        @SC86299 06262000
  2526.          CVD   6,TMPDW                                         @SC86299 06262500
  2527.          MVC   KFSDATE+2(2),TMPDW+5                            @SC86299 06263000
  2528.          MVI   KFSDATE,X'19' Assume 20th Cent                  @SC86295 06263500
  2529.          CLI   KFSDATE+1,X'50'                                 @SC86295 06264000
  2530.          BH    *+8           Ok                                @SC86295 06264500
  2531.          MVI   KFSDATE,X'20' Must be 21st                      @SC86295 06265000
  2532.          MVO   TMPDW,EIBTIME Get time from 0hhmmss+            @SC91150 06265500
  2533.          MVC   KFSDATE+4(3),TMPDW+4  Copy just hhmmss          @SC91150 06266000
  2534.          MVC   KFSNREC,FABRN Save number of records            @SC90264 06266500
  2535.          MVC   KFLRN,=5C'0'  Clear for key                     @SC90264 06267000
  2536.          EXEC CICS DELETE DATASET(KFILE) RIDFLD(KFLFUID),      @SC91150+06267500
  2537.                NOHANDLE,     Remove previous directory block   @SC91150 06268000
  2538.          UNPK  KFLFDAT(15),KFSDAT(8)                           @SC90264 06268500
  2539.          UNPK  KFLFDAT+14(15),KFSDAT+7(8)                      @SC90264 06269000
  2540.          UNPK  KFLFDAT+28(3),KFSDAT+14(2)                      @SC90264 06269500
  2541. * - - - - - - Extend these UNPK instrs if KFSLEN grows         @SC90264 06270000
  2542.          TR    KFLFDAT(2*KFSLEN),KFLHEXY-C'0'                  @SC90264 06270500
  2543.          LA    6,KFLFUID                                       @SC90264 06271000
  2544.          MVC   FABNORD,=Y(KFSLEN*2+LFKEY)                      @SC90264 06271500
  2545.          B     KFLWRT2       Write new dir block out           @SC90264 06272000
  2546. * Open a file for output                                       @SC90264 06272500
  2547. KFLOPO   CLC   =C'OPEN O',FABCOMM                              @SC90264 06273000
  2548.          BNE   KFLOPI                                          @SC90264 06273500
  2549. *------------------------- Quota checking ------------         @SC90264 06274000
  2550.          CLC   FABFUID,CURFUID Current userid?                 @SC90264 06274500
  2551.          BNE   KFLOPO1       No, assume it's ok                @SC90264 06275000
  2552.          CLC   FABFUID,SYSUID Global directory?                @SC90264 06275500
  2553.          BE    KFLOPO1       Yes, never limit that             @SC90264 06276000
  2554.          CLC   USRTOTL,LIMKFS See if over quota                @SC90264 06276500
  2555.          BNL   RTRN1         Yes, quit                         @SC90264 06277000
  2556. *-------------------------                                     @SC90264 06277500
  2557. KFLOPO1  LTR   4,4           Does it exist?                    @SC90264 06278000
  2558.          BZ    KFLOPO2       Not there, must create new block  @SC90264 06278500
  2559.          MVC   FABRN,KFSNREC If it's there, we append          @SC90264 06279000
  2560.          L     0,USRTOTL                                       @SC90264 06279500
  2561.          SL    0,KFSSIZE     ... but don't count twice in total@SC90264 06280000
  2562.          ST    0,USRTOTL                                       @SC90264 06280500
  2563.          B     RTRN0                                           @SC90264 06281000
  2564. KFLOPO2  L     4,TMPBLK      Ptr to block if not current dir.  @SC90264 06281500
  2565.          CLC   FABFUID,CURFUID Current?                        @SC90264 06282000
  2566.          BNE   KFLOPO3       No, just set it up                @SC90264 06282500
  2567.          LA    4,PTRKFS      Yes, start through chain          @SC90264 06283000
  2568. KFLOLP   LR    6,4           Save ptr to this block            @SC90264 06283500
  2569.          ICM   4,15,KFSNEXT  Get ptr to next block             @SC90264 06284000
  2570.          BZ    KFLONEW       Hit end, file not found           @SC90264 06284500
  2571.          CLC   FABFNAM,KFSFNAM Match?                          @SC90264 06285000
  2572.          BH    KFLOLP        No, keep looking                  @SC90264 06285500
  2573. KFLONEW  BAL   2,KFLCGB      Prepare new block                 @SC90264 06286000
  2574.          MVC   KFSNEXT,0(6)  Link into chain: 6->previous      @SC90264 06286500
  2575.          ST    4,KFSNEXT-KFSBLK(,6)                            @SC90264 06287000
  2576.          ST    6,KFSPREV     Set backward ptr in new block     @SC90264 06287500
  2577.          ICM   7,15,KFSNEXT  Added to end?                     @SC90264 06288000
  2578.          BZ    *+8           Yes, done linking                 @SC90264 06288500
  2579.           ST   4,KFSPREV-KFSBLK(,7) No, set back ptr in next   @SC90264 06289000
  2580. KFLOPO3  ST    4,FABUWORD    Save ptr in FAB                   @SC90264 06289500
  2581.          MVC   KFSFUID(LFUID+LFFNM),FABFUID                    @SC90264 06290000
  2582.          XC    KFSDAT(KFSLEN),KFSDAT                           @SC90264 06290500
  2583.          B     RTRN0                                           @SC90264 06291000
  2584. * Open input file                                              @SC90264 06291500
  2585. KFLOPI   B     RTRN0                                           @SC90264 06292000
  2586. *                                                                       06292500
  2587. * Look up file given in FAB.  1->FAB.  Set up TMPBLK if nec.   @SC90264 06293000
  2588. *  Return 15=0 and 1->block if found, 15=1 otherwise.          @SC90264 06293500
  2589. *                                                                       06294000
  2590. KFLLKP   ENTER ALT                                             @SC90264 06294500
  2591.          L     8,DFHEIBP     Get addressability                @SC90264 06295000
  2592.          LR    3,1           Address FAB                       @SC90264 06295500
  2593.          MVI   FDBRCF,C'V'   Enforce RECFM=V                   @SC91150 06296000
  2594.          CLC   FABFUID,CURFUID File in current directory?      @SC91150 06296500
  2595.          BNE   KFLLOTH       No, must get individual block     @SC90264 06297000
  2596.          LA    4,PTRKFS      Yes, start through chain          @SC90264 06297500
  2597. KFLLLP   LR    6,4           Save ptr to this block            @SC90264 06298000
  2598.          ICM   4,15,KFSNEXT  Get ptr to next block             @SC90264 06298500
  2599.          BZ    RTRN1         Hit end, file not found           @SC90264 06299000
  2600.          CLC   FABFNAM,KFSFNAM Match?                          @SC90264 06299500
  2601.          BH    KFLLLP        No, keep looking                  @SC90264 06300000
  2602.          BL    RTRN1         No, passed the right point        @SC90264 06300500
  2603. KFLLRET  RETREG (1,4)        Found file, return ptr to block   @SC90264 06301000
  2604.          ST    4,FABUWORD    Save ptr in FAB                   @SC90264 06301500
  2605.          B     RTRN0                                           @SC90264 06302000
  2606. KFLLOTH  ICM   4,15,TMPBLK   See if temp block already set up  @SC90264 06302500
  2607.          BNZ   KFLLOTH2      Yes, use it                       @SC90264 06303000
  2608.          BAL   2,KFLCGB      No, get a block                   @SC90264 06303500
  2609.          ST    4,TMPBLK                                        @SC90264 06304000
  2610.          MVI   KFSFUID,0     Mark it unused                    @SC90264 06304500
  2611. KFLLOTH2 CLC   KFSFUID(LFUID+LFFNM),FABFUID Same as before?    @SC90264 06305000
  2612.          BE    KFLLRET       Yes, just return                  @SC90264 06305500
  2613.          MVC   KFLFUID(LFUID+LFFNM),FABFUID Set key            @SC90264 06306000
  2614.          BAL   2,KFLCRED     Read a directory block            @SC90264 06306500
  2615.           B    RTRN1                                           @SC90264 06307000
  2616.          CLC   KFSFUID(LFUID+LFFNM),FABFUID Found right one?   @SC90264 06307500
  2617.          BNE   RTRN1         No, too bad                       @SC90264 06308000
  2618.          B     KFLLRET       Yes, return result                @SC90264 06308500
  2619. *                                                                       06309000
  2620. * (Re)set current directory within Kermit file system          @SC90264 06309500
  2621. *  R1->H(length),CLn new directory name.  If it begins with ', @SC90264 06310000
  2622. *  the name is a prefix for external file names.  If it is     @SC90264 06310500
  2623. *  just *, it is equivalent to the value in KUSERID.           @SC90264 06311000
  2624. *                                                                       06311500
  2625. KFLCWD   ENTER ALT                                             @SC90264 06312000
  2626.          L     8,DFHEIBP     Get addressability                @SC90264 06312500
  2627.          LH    7,0(1)        Get length                        @SC90264 06313000
  2628.          LA    6,2(,1)       And address                       @SC90264 06313500
  2629.          LTR   7,7           Anything in the string?           @SC90264 06314000
  2630.          BZ    KFLCDRP       No, just drop old directory       @SC90264 06314500
  2631.          CLI   0(6),C''''    External names?                   @SC90264 06315000
  2632.          BE    KFLCDRP       Yes, drop old                     @SC90264 06315500
  2633.          C     7,F1          Is string just '*'?               @SC90264 06316000
  2634.          BNE   KFLCCMP                                         @SC90264 06316500
  2635.          CLI   0(6),C'*'                                       @SC90264 06317000
  2636.          BNE   KFLCCMP       No                                @SC90264 06317500
  2637.          LA    6,KUSERID     Yes, use true userid instead      @SC90264 06318000
  2638. KFLLAUID LA    7,LFUID                                         @SC90264 06318500
  2639. KFLCCMP  LA    15,0(7,6)     Point past string                 @SC90264 06319000
  2640.          CH    7,KFLLAUID+2  Shorter than usual?               @SC90264 06319500
  2641.          BNL   *+10          No, that's ok                     @SC90264 06320000
  2642.           MVC  0(LFUID,15),=CL(LFUID)' ' Yes, pad with blanks  @SC90264 06320500
  2643.          CLC   CURFUID,0(6)  Compare with current directory    @SC90264 06321000
  2644.          BE    RTRN0         Matches, nothing to do            @SC90264 06321500
  2645. KFLCDRP  CLI   CURFUID,0     Any current directory?            @SC90264 06322000
  2646.          BE    KFLCSET       No, nothing to drop               @SC90264 06322500
  2647.          BAL   2,KFLCRB      Yes, drop all blocks              @SC90264 06323000
  2648.          MVI   CURFUID,0     and wipe out name                 @SC90264 06323500
  2649. KFLCSET  CLI   0(6),C''''    External names?                   @SC90264 06324000
  2650.          BE    RTRN0         Yes, no new directory             @SC90264 06324500
  2651.          MVC   USRTOTL,F0    Clear total space used            @SC90264 06325000
  2652.          MVC   CURFUID,0(6)  Set new directory name            @SC90264 06325500
  2653.          CLI   CURFUID,0     Final cleanup?                    @SC90264 06326000
  2654.          BE    KFLCLEAN      Yes, release storage              @SC90264 06326500
  2655.          MVC   KFLFUID,0(6)  Set key for reading               @SC90264 06327000
  2656.          XC    KFLFNAM(LFFNM),KFLFNAM                          @SC90264 06327500
  2657.          LA    7,PTRKFS      Anchor of chain                   @SC90264 06328000
  2658. KFLCLP   BAL   2,KFLCGB      Get a free block: ptr in R4       @SC90264 06328500
  2659.          BAL   2,KFLCRED     Read a directory block            @SC90264 06329000
  2660.           B    KFLCLQ        Couldn't, we must be finished     @SC90264 06329500
  2661.          ST    4,0(,7)       Link onto chain                   @SC90264 06330000
  2662.          ST    7,KFSPREV     Link backwards, too               @SC90264 06330500
  2663.          LR    7,4           Set new end of chain              @SC90264 06331000
  2664.          AL    0,USRTOTL     Add up space used                 @SC90264 06331500
  2665.          BC    12,*+8        No carry                          @SC90264 06332000
  2666.           SLR  0,0                                             @SC90264 06332500
  2667.           BCTR 0,0           Set total to max                  @SC90264 06333000
  2668.          ST    0,USRTOTL     Keep new total                    @SC90264 06333500
  2669.          LM    0,1,KFSFNAM   Get name of file                  @SC90264 06334000
  2670.          AL    1,F1          And bump 1                        @SC90264 06334500
  2671.          BC    12,*+8        No carry                          @SC90264 06335000
  2672.           AL   0,F1          Carry                             @SC90264 06335500
  2673.          STM   0,1,KFLFNAM   Save as next key for search       @SC90264 06336000
  2674.          B     KFLCLP        Go get another                    @SC90264 06336500
  2675. KFLCLQ   MVC   KFSNEXT,PTRFRE This block is left over          @SC90264 06337000
  2676.          ST    4,PTRFRE                                        @SC90264 06337500
  2677.          B     RTRN0                                           @SC90264 06338000
  2678. *                                                                       06338500
  2679. * Release all storage                                          @SC90264 06339000
  2680. KFLCLEAN MVC   PTRFRE,F0                                       @SC90264 06339500
  2681.          MVC   PTRKFS,F0                                       @SC90264 06340000
  2682.          MVC   TMPBLK,F0                                       @SC90264 06340500
  2683. KFLCLLP  ICM   1,15,PTRFREM  Get ptr to next megablock         @SC90264 06341000
  2684.          BZ    RTRN0         No more, done freeing             @SC90264 06341500
  2685.          MVC   PTRFREM,0(1)  Unchain it                        @SC90264 06342000
  2686.          LA    0,KFSDWDS*20+1                                  @SC90264 06342500
  2687.          DMSFRET LOC=(1),DWORDS=(0) ... and free it            @SC90264 06343000
  2688.          B     KFLCLLP                                         @SC90264 06343500
  2689. *                                                                       06344000
  2690. * Read a directory block into buffer: key set up in KFLFUID.   @SC90264 06344500
  2691. *   Return to (2) if ok, else skip. Clobbers R5                @SC90264 06345000
  2692. *   Returns R0 = size of file in bytes                         @SC90264 06345500
  2693. *                                                                       06346000
  2694. KFLCRED  EXEC CICS READ DATASET(KFILE) RIDFLD(KFLFUID),        @SC90264+06346500
  2695.                KEYLENGTH(=Y(LFUID+LFFNM)) GENERIC GTEQ,        @SC90264+06347000
  2696.                SET(5) LENGTH(KFLBLN) NOHANDLE,                 @SC90264 06347500
  2697.          CLC   F0,EIBRCODE                                     @SC90264 06348000
  2698.          BNER  2             I/O error of some sort            @SC90264 06348500
  2699.          CLC   KFLFUID,0(5)  Did we get the right uid?         @SC90264 06349000
  2700.          BNER  2             No, we must be finished           @SC90264 06349500
  2701.          MVC   KFSFUID(LFUID+LFFNM),0(5)  Ok so far, copy name @SC90264 06350000
  2702.          CLC   KFLBLN,=Y(KFSLEN*2+LFKEY) Valid block?          @SC90264 06350500
  2703. *        BNL   KFLCRPK       Ok so far, verify it              @SC90264 06351000
  2704. * - - - - - Insert code to compensate for missing info in any  @SC90264 06351500
  2705. *           supported shorter block length                     @SC90264 06352000
  2706.          BLR   2             No, quit now                      @SC90264 06352500
  2707. KFLCRPK  PACK  KFSDAT(8),LFKEY(15,5)                           @SC90264 06353000
  2708.          PACK  KFSDAT+7(8),LFKEY+14(15,5)                      @SC90264 06353500
  2709.          PACK  KFSDAT+14(2),LFKEY+28(3,5)                      @SC90264 06354000
  2710. * - - - - - - Extend these PACK instrs if KFSLEN grows         @SC90264 06354500
  2711.          ICM   0,3,KFSNREC   Is this a valid block?            @SC90264 06355000
  2712.          BNPR  2             No, stop here                     @SC90264 06355500
  2713.          ICM   0,15,KFSSIZE  ditto                             @SC90264 06356000
  2714.          BNPR  2                                               @SC90264 06356500
  2715.          B     4(,2)         Return and skip                   @SC90264 06357000
  2716. *                                                                       06357500
  2717. * Get a free block for directory, create new if necessary      @SC90264 06358000
  2718. *  Return via R2, ptr in R4, uses R0,R1,R14,R15                @SC90264 06358500
  2719. KFLCGB   ICM   4,15,PTRFRE   Get a free block                  @SC90264 06359000
  2720.          BNZ   KFLCGB2       Ok, use it                        @SC90264 06359500
  2721.          LA    0,KFSDWDS*20+1 No, must assign some more        @SC90264 06360000
  2722.          DMSFREE DWORDS=(0),ERR=RTRN1                          @SC90264 06360500
  2723.          MVC   0(4,1),PTRFREM Link to megablock chain          @SC90264 06361000
  2724.          ST    1,PTRFREM                                       @SC90264 06361500
  2725.          LA    4,4(,1)       Skip over megablock ptr           @SC90264 06362000
  2726.          LA    15,20         Partition into 20 blocks          @SC90264 06362500
  2727. KFLCGBLP MVC   KFSNEXT,PTRFRE Link to free chain               @SC90264 06363000
  2728.          ST    4,PTRFRE                                        @SC90264 06363500
  2729.          LA    4,KFSDWDS*8(,4) Skip to next block              @SC90264 06364000
  2730.          BCT   15,KFLCGBLP                                     @SC90264 06364500
  2731.          B     KFLCGB        Now try again                     @SC90264 06365000
  2732. KFLCGB2  MVC   PTRFRE,KFSNEXT Unchain the block                @SC90264 06365500
  2733.          MVC   KFSNEXT,F0                                      @SC90264 06366000
  2734.          BR    2                                               @SC90264 06366500
  2735. *                                                                       06367000
  2736. * Release all directory blocks in current directory            @SC90264 06367500
  2737. *  Return via R2.  Uses R0,R14,R15                             @SC90264 06368000
  2738. KFLCRB   ICM   0,15,PTRKFS   Any directory?                    @SC90264 06368500
  2739.          BZR   2             No, all done                      @SC90264 06369000
  2740.          MVC   PTRKFS,F0     Yes, unchain all blocks           @SC90264 06369500
  2741.          LA    15,PTRFRE     Start of free chain               @SC90264 06370000
  2742.          LR    14,15                                           @SC90264 06370500
  2743.          ICM   15,15,0(14)   Find end of free chain            @SC90264 06371000
  2744.          BNZ   *-6           Saw another, keep looking         @SC90264 06371500
  2745.          ST    0,0(,14)      Link whole directory onto end     @SC90264 06372000
  2746.          BR    2                                               @SC90264 06372500
  2747. *                                                                       06373000
  2748.          DROP  3,4,8                                           @SC91150 06373500
  2749. *                                                                       06374000
  2750. KFLHEXY  DC    C'0123456789',X'7A7B7C7D7E7F'  Printable codes  @SC90264 06374500
  2751. *                               : # @ ' = "  with proper digit @SC90264 06375000
  2752.          LOCALS ,                                              @SC90264 06375500
  2753. KFLDW    DS    0D            Temporary                         @SC90264 06376000
  2754. KFLFUID  DS    CL(LFUID)     Room for key                      @SC90264 06376500
  2755. KFLFNAM  DS    CL(LFFNM)     (including this)                  @SC90264 06377000
  2756. KFLRN    DS    CL5                                             @SC90264 06377500
  2757. KFLFDAT  DS    CL(2*KFSLEN)                                    @SC90264 06378000
  2758. KFLBLN   DS    H             Length of record                  @SC90264 06378500
  2759. KFLMNTH  DS    XL11          Month length table                @SC86299 06379000
  2760. *                                                                       06379500
  2761.          EXIT  ,                                               @SC90264 06380000
  2762.